diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryToolbarNode.swift b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryToolbarNode.swift index 0a0f2f4142..876f1325bb 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryToolbarNode.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryToolbarNode.swift @@ -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() } } diff --git a/submodules/TelegramCore/Sources/Statistics/StoryStatistics.swift b/submodules/TelegramCore/Sources/Statistics/StoryStatistics.swift index 4ef959885a..a3b35e7bfe 100644 --- a/submodules/TelegramCore/Sources/Statistics/StoryStatistics.swift +++ b/submodules/TelegramCore/Sources/Statistics/StoryStatistics.swift @@ -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 { diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentButtonNode/Sources/ChatMessageAttachedContentButtonNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentButtonNode/Sources/ChatMessageAttachedContentButtonNode.swift index ecb14a0075..ae5c65eeda 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentButtonNode/Sources/ChatMessageAttachedContentButtonNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentButtonNode/Sources/ChatMessageAttachedContentButtonNode.swift @@ -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() }) } diff --git a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/FlipButtonContentComponent.swift b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/FlipButtonContentComponent.swift index ea71fcc02d..ae34bafa02 100644 --- a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/FlipButtonContentComponent.swift +++ b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/FlipButtonContentComponent.swift @@ -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() diff --git a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift index 762e1f8f6b..f8b67f7700 100644 --- a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift +++ b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift @@ -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)), diff --git a/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreenState.swift b/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreenState.swift index 241ee1d82d..89d1bdf7a2 100644 --- a/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreenState.swift +++ b/submodules/TelegramUI/Components/ShareWithPeersScreen/Sources/ShareWithPeersScreenState.swift @@ -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 { diff --git a/submodules/TelegramUI/Sources/ChatThemeScreen.swift b/submodules/TelegramUI/Sources/ChatThemeScreen.swift index bc794e0aa3..8b2e570ad4 100644 --- a/submodules/TelegramUI/Sources/ChatThemeScreen.swift +++ b/submodules/TelegramUI/Sources/ChatThemeScreen.swift @@ -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 {