From 79a7f064c586b77c9f987e17044d2e2ca33252a1 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Tue, 30 Aug 2022 21:21:00 +0400 Subject: [PATCH] Fix animation --- .../Sources/EmojiStatusSelectionComponent.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift b/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift index f7a215f1f9..42f84d9a2e 100644 --- a/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift +++ b/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift @@ -234,6 +234,7 @@ public final class EmojiStatusSelectionController: ViewController { private var hapticFeedback: HapticFeedback? + private var isAnimatingOut: Bool = false private var isDismissed: Bool = false init(controller: EmojiStatusSelectionController, context: AccountContext, sourceView: UIView?, emojiContent: Signal) { @@ -373,6 +374,11 @@ public final class EmojiStatusSelectionController: ViewController { } func animateOut(completion: @escaping () -> Void) { + if self.isAnimatingOut { + return + } + self.isAnimatingOut = true + self.componentShadowLayer.animateAlpha(from: 1.0, to: 0.0, duration: 0.25, removeOnCompletion: false) self.componentHost.view?.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.25, removeOnCompletion: false, completion: { _ in completion()