From b4ffedcc3dc513863fc6ab01061d9cd3790d41f5 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 24 Apr 2023 14:10:31 +0400 Subject: [PATCH] Fix chat loading placeholder --- submodules/TelegramUI/Sources/ChatLoadingNode.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramUI/Sources/ChatLoadingNode.swift b/submodules/TelegramUI/Sources/ChatLoadingNode.swift index 58da776a90..b194b51613 100644 --- a/submodules/TelegramUI/Sources/ChatLoadingNode.swift +++ b/submodules/TelegramUI/Sources/ChatLoadingNode.swift @@ -209,7 +209,9 @@ final class ChatLoadingPlaceholderNode: ASDisplayNode { if self.context.sharedContext.energyUsageSettings.fullTranslucency { Queue.mainQueue().after(0.3) { - self.backgroundNode?.updateIsLooping(true) + if !self.didAnimateOut { + self.backgroundNode?.updateIsLooping(true) + } } } } @@ -282,11 +284,12 @@ final class ChatLoadingPlaceholderNode: ASDisplayNode { self.borderMaskNode.bounds = self.borderMaskNode.bounds.offsetBy(dx: 0.0, dy: inset) } + private var didAnimateOut = false func animateOut(_ historyNode: ChatHistoryNode, completion: @escaping () -> Void = {}) { guard let listNode = historyNode as? ListView, let (size, _, _) = self.validLayout else { return } - + self.didAnimateOut = true self.backgroundNode?.updateIsLooping(false) let transition = ContainedViewLayoutTransition.animated(duration: 0.3, curve: .spring)