From 3d10a9159ae3b50d42df8548b4c547ad5fd73643 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Wed, 3 Feb 2021 23:38:18 +0200 Subject: [PATCH] Fix removing delay after bubbles animation --- src/components/chat/bubbles.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 926f2ed7..c92a04fd 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -2893,7 +2893,9 @@ export default class ChatBubbles { let promise: Promise; if(topIds.length || middleIds.length || bottomIds.length) { promise = Promise.all(promises); - promise.then(() => { + + dispatchHeavyAnimationEvent(promise, Math.max(...delays) + 200) // * 200 - transition time + .then(() => { fastRaf(() => { setBubbles.forEach(contentWrapper => { contentWrapper.style.transitionDelay = ''; @@ -2906,7 +2908,6 @@ export default class ChatBubbles { this.needReflowScroll = true; } }); - dispatchHeavyAnimationEvent(promise, Math.max(...delays) + 200); // * 200 - transition time } (promise || Promise.resolve()).then(() => {