mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various fixes
This commit is contained in:
@@ -190,7 +190,13 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode, WallpaperGalleryToolbar
|
||||
}
|
||||
}
|
||||
|
||||
private var previousActionTime: Double?
|
||||
@objc func pressed() {
|
||||
let currentTime = CACurrentMediaTime()
|
||||
if let previousActionTime = self.previousActionTime, currentTime < previousActionTime + 1.0 {
|
||||
return
|
||||
}
|
||||
self.previousActionTime = currentTime
|
||||
self.action()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ private final class StoryStatsPublicForwardsContextImpl {
|
||||
peers[groupOrChannel.id] = groupOrChannel
|
||||
}
|
||||
}
|
||||
updatePeers(transaction: transaction, accountPeerId: accountPeerId, peers: AccumulatedPeers(users: users))
|
||||
updatePeers(transaction: transaction, accountPeerId: accountPeerId, peers: AccumulatedPeers(peers: Array(peers.values)))
|
||||
var resultForwards: [StoryStatsPublicForwardsContext.State.Forward] = []
|
||||
for forward in forwards {
|
||||
switch forward {
|
||||
|
||||
@@ -78,7 +78,7 @@ public final class ChatMessageAttachedContentButtonNode: HighlightTrackingButton
|
||||
return
|
||||
}
|
||||
self.shimmerEffectNode = nil
|
||||
shimmerEffectNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, completion: { [weak shimmerEffectNode] _ in
|
||||
shimmerEffectNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak shimmerEffectNode] _ in
|
||||
shimmerEffectNode?.removeFromSupernode()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,16 +4,29 @@ import Display
|
||||
import ComponentFlow
|
||||
|
||||
final class FlipButtonContentComponent: Component {
|
||||
init() {
|
||||
let tag: AnyObject?
|
||||
|
||||
init(
|
||||
tag: AnyObject?
|
||||
) {
|
||||
self.tag = tag
|
||||
}
|
||||
|
||||
static func ==(lhs: FlipButtonContentComponent, rhs: FlipButtonContentComponent) -> Bool {
|
||||
return lhs === rhs
|
||||
}
|
||||
|
||||
final class View: UIView {
|
||||
final class View: UIView, ComponentTaggedView {
|
||||
private var component: FlipButtonContentComponent?
|
||||
public func matches(tag: Any) -> Bool {
|
||||
if let component = self.component, let componentTag = component.tag {
|
||||
let tag = tag as AnyObject
|
||||
if componentTag === tag {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private let backgroundView: BlurredBackgroundView
|
||||
private let icon = SimpleLayer()
|
||||
|
||||
@@ -42,6 +42,7 @@ import ForwardInfoPanelComponent
|
||||
private let playbackButtonTag = GenericComponentViewTag()
|
||||
private let muteButtonTag = GenericComponentViewTag()
|
||||
private let saveButtonTag = GenericComponentViewTag()
|
||||
private let switchCameraButtonTag = GenericComponentViewTag()
|
||||
|
||||
final class MediaEditorScreenComponent: Component {
|
||||
typealias EnvironmentType = ViewControllerComponentContainer.Environment
|
||||
@@ -1736,11 +1737,15 @@ final class MediaEditorScreenComponent: Component {
|
||||
transition: transition,
|
||||
component: AnyComponent(Button(
|
||||
content: AnyComponent(
|
||||
FlipButtonContentComponent()
|
||||
FlipButtonContentComponent(tag: switchCameraButtonTag)
|
||||
),
|
||||
action: { [weak self] in
|
||||
if let self, let environment = self.environment, let controller = environment.controller() as? MediaEditorScreen {
|
||||
controller.node.recording.togglePosition()
|
||||
|
||||
if let view = self.switchCameraButton.findTaggedView(tag: switchCameraButtonTag) as? FlipButtonContentComponent.View {
|
||||
view.playAnimation()
|
||||
}
|
||||
}
|
||||
}
|
||||
).withIsExclusive(false)),
|
||||
|
||||
@@ -335,6 +335,9 @@ public extension ShareWithPeersScreen {
|
||||
var peers: [EnginePeer] = []
|
||||
peers = chatList.items.filter { peer in
|
||||
if let peer = peer.renderedPeer.peer {
|
||||
if case .secretChat = peer {
|
||||
return false
|
||||
}
|
||||
if self.initialPeerIds.contains(peer.id) {
|
||||
return false
|
||||
}
|
||||
@@ -478,7 +481,9 @@ public extension ShareWithPeersScreen {
|
||||
|
||||
let state = State(
|
||||
peers: peers.compactMap { $0.peer }.filter { peer in
|
||||
if case let .user(user) = peer {
|
||||
if case .secretChat = peer {
|
||||
return false
|
||||
} else if case let .user(user) = peer {
|
||||
if user.id == context.account.peerId {
|
||||
return false
|
||||
} else if user.botInfo != nil {
|
||||
|
||||
@@ -415,7 +415,7 @@ private final class ThemeSettingsThemeItemIconNode : ListViewItemNode {
|
||||
}
|
||||
}
|
||||
if item.themeReference == nil {
|
||||
strongSelf.imageNode.backgroundColor = item.theme.actionSheet.opaqueItemBackgroundColor
|
||||
strongSelf.imageNode.backgroundColor = item.theme.list.plainBackgroundColor
|
||||
}
|
||||
|
||||
if updatedTheme || updatedSelected {
|
||||
|
||||
Reference in New Issue
Block a user