mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 09:20:08 +00:00
Don't apply animation if not yet finished
This commit is contained in:
parent
df6e87cc3d
commit
68ab84bed4
@ -141,6 +141,7 @@ public final class LottieAnimationComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let animationView = self.animationView, animationView.isAnimationPlaying {
|
if let animationView = self.animationView, animationView.isAnimationPlaying {
|
||||||
|
updateComponent = false
|
||||||
self.currentCompletion = { [weak self] in
|
self.currentCompletion = { [weak self] in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
@ -154,6 +155,7 @@ public final class LottieAnimationComponent: Component {
|
|||||||
|
|
||||||
self.animationView?.removeFromSuperview()
|
self.animationView?.removeFromSuperview()
|
||||||
self.didPlayToCompletion = false
|
self.didPlayToCompletion = false
|
||||||
|
self.currentCompletion = nil
|
||||||
|
|
||||||
if let url = getAppBundle().url(forResource: component.animation.name, withExtension: "json"), let animation = Animation.filepath(url.path) {
|
if let url = getAppBundle().url(forResource: component.animation.name, withExtension: "json"), let animation = Animation.filepath(url.path) {
|
||||||
let view = AnimationView(animation: animation, configuration: LottieConfiguration(renderingEngine: .mainThread, decodingStrategy: .codable))
|
let view = AnimationView(animation: animation, configuration: LottieConfiguration(renderingEngine: .mainThread, decodingStrategy: .codable))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user