From eeb8af3ca630e140340133771d97e78e20af697c Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 22 Aug 2023 16:08:52 +0200 Subject: [PATCH] Fix a glitch in history re-open while loading. --- .../SourceFiles/history/history_widget.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 3be81b775..e4dad4d47 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2031,12 +2031,19 @@ void HistoryWidget::showHistory( } const auto canShowNow = _history->isReadyFor(showAtMsgId); if (!canShowNow) { - DEBUG_LOG(("JumpToEnd(%1, %2, %3): Showing delayed at %4." - ).arg(_history->peer->name() - ).arg(_history->inboxReadTillId().bare - ).arg(Logs::b(_history->loadedAtBottom()) - ).arg(showAtMsgId.bare)); - delayedShowAt(showAtMsgId); + if (!_firstLoadRequest) { + DEBUG_LOG(("JumpToEnd(%1, %2, %3): Showing delayed at %4." + ).arg(_history->peer->name() + ).arg(_history->inboxReadTillId().bare + ).arg(Logs::b(_history->loadedAtBottom()) + ).arg(showAtMsgId.bare)); + delayedShowAt(showAtMsgId); + } else if (_showAtMsgId != showAtMsgId) { + clearAllLoadRequests(); + setMsgId(showAtMsgId); + firstLoadMessages(); + doneShow(); + } } else { _history->forgetScrollState(); if (_migrated) {