From 1653733df4bd4b27cf484dfe2f074fa5126992a6 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Tue, 13 Apr 2021 23:06:03 +0400 Subject: [PATCH] Fix loading new messages with saved position --- src/components/chat/bubbles.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 9548e1b5..84ce628c 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -1587,10 +1587,16 @@ export default class ChatBubbles { this.chat.dispatchEvent('setPeer', lastMsgId, !isJump); // warning - if(!lastMsgId || this.bubbles[topMessage] || lastMsgId === topMessage) { + if((!lastMsgId && !savedPosition) || this.bubbles[topMessage] || lastMsgId === topMessage) { this.scrollable.loadedAll.bottom = true; } + if(savedPosition) { + Promise.all([setPeerPromise, getHeavyAnimationPromise()]).then(() => { + this.scrollable.checkForTriggers(); + }); + } + this.log('scrolledAllDown:', this.scrollable.loadedAll.bottom); //if(!this.unreaded.length && dialog) { // lol