From 70bde5f7d551d167fe3aeb8b24131cf4b484809d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 7 Jul 2026 13:29:05 +0300 Subject: [PATCH] Fixed last post overlapping pull-to-next card while loading. --- .../history/history_view_pull_to_next_channel.cpp | 6 ++++-- .../SourceFiles/history/history_view_pull_to_next_channel.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_view_pull_to_next_channel.cpp b/Telegram/SourceFiles/history/history_view_pull_to_next_channel.cpp index 09d79275ef..74b750b54f 100644 --- a/Telegram/SourceFiles/history/history_view_pull_to_next_channel.cpp +++ b/Telegram/SourceFiles/history/history_view_pull_to_next_channel.cpp @@ -677,6 +677,7 @@ void PullToNextChannel::handleOverscroll( && (next->unreadCount() > 0) && active()) { _pulling = false; + _jumping = true; _scroll->setContentBottomInset(int(base::SafeRound(_effective))); crl::on_main(_parent.get(), [=] { jumpWhenReady(next, 0); }); return; @@ -691,6 +692,7 @@ void PullToNextChannel::clearState() { _dwellTimer.cancel(); _pulling = false; _committed = false; + _jumping = false; _reached = false; _peakPull = 0.; _pull = 0.; @@ -725,8 +727,8 @@ void PullToNextChannel::pushIndicator() { float64(st::historyPullNextMaxHeight), _pull + expand * (card - threshold)); _effective = effective; - _scroll->setContentBottomInset( - std::max(0, int(base::SafeRound(effective - _pull)))); + _scroll->setContentBottomInset(std::max(0, int(base::SafeRound( + _jumping ? effective : (effective - _pull))))); _indicator->setData(effective, _reached, _next); _hint->setData(_pull > 0., _reached, _next); } diff --git a/Telegram/SourceFiles/history/history_view_pull_to_next_channel.h b/Telegram/SourceFiles/history/history_view_pull_to_next_channel.h index d224c86fe9..a598453026 100644 --- a/Telegram/SourceFiles/history/history_view_pull_to_next_channel.h +++ b/Telegram/SourceFiles/history/history_view_pull_to_next_channel.h @@ -68,6 +68,7 @@ private: bool _pulling = false; bool _committed = false; + bool _jumping = false; bool _reached = false; bool _expandTo = false; float64 _pull = 0.;