From e9c2df4bebccc132b0c8b46c88146b05b7acc0cd Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 10 Nov 2022 18:28:00 +0400 Subject: [PATCH] RLottie: Fix duplicated frame renders --- src/lib/rlottie/RLottie.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/rlottie/RLottie.ts b/src/lib/rlottie/RLottie.ts index e3df57966..b4bc4d247 100644 --- a/src/lib/rlottie/RLottie.ts +++ b/src/lib/rlottie/RLottie.ts @@ -340,7 +340,10 @@ class RLottie { const chunk = this.chunks[chunkIndex]; if (!chunk || chunk.length === 0) { - this.requestChunk(chunkIndex); + if (!chunk) { + this.requestChunk(chunkIndex); + } + this.isAnimating = false; this.isWaiting = true; return false; @@ -471,7 +474,7 @@ class RLottie { } private requestChunk(chunkIndex: number) { - if (this.chunks[chunkIndex] && this.chunks[chunkIndex]?.length !== 0) { + if (this.chunks[chunkIndex]) { return; }