From 9dd2e07b95056eb83398ae0a2d8fdce5500bbf81 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Fri, 21 Jul 2023 02:27:44 +0400 Subject: [PATCH] Fix unnecessary bounce --- .../Sources/StoryPeerListComponent.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift index 2105d59266..2014e0089f 100644 --- a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift @@ -1484,6 +1484,11 @@ public final class StoryPeerListComponent: Component { ) } + var allowBounce = !previousComponent.unlocked && component.unlocked + if let animationHint, !animationHint.bounce { + allowBounce = false + } + self.animationState = AnimationState( duration: duration * UIView.animationDurationFactor(), fromIsUnlocked: previousComponent.unlocked, @@ -1491,7 +1496,7 @@ public final class StoryPeerListComponent: Component { fromTitleWidth: self.currentTitleWidth, fromActivityFraction: self.currentActivityFraction, startTime: timestamp, - bounce: animationHint?.bounce ?? true + bounce: allowBounce ) }