From 02cfa48dd8140f6e9c8d1532f97204db4bd4b0ca Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Sun, 3 Apr 2022 14:53:45 +0300 Subject: [PATCH] Disable chat slicing on scroll --- src/components/chat/bubbles.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 3c2583b4..bc5d356d 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -682,9 +682,9 @@ export default class ChatBubbles { } }); - if(!IS_SAFARI) { - this.sliceViewportDebounced = debounce(this.sliceViewport.bind(this), 100, false, true); - } + // if(!IS_SAFARI) { + // this.sliceViewportDebounced = debounce(this.sliceViewport.bind(this), 100, false, true); + // } let middleware: ReturnType; useHeavyAnimationCheck(() => { @@ -4047,7 +4047,8 @@ export default class ChatBubbles { scrollSaver.restore(history.length === 1 && !reverse ? false : true); const state = scrollSaver.getSaved(); - if(state.scrollHeight !== state.clientHeight) { + const isLoading = !this.preloader.detached; + if(state.scrollHeight !== state.clientHeight || isLoading) { /* for(const timestamp in this.dateMessages) { const dateMessage = this.dateMessages[timestamp]; dateMessage.div.classList.add('is-sticky');