mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Fix scroll through pinned items.
This commit is contained in:
parent
324affb8b9
commit
3febace163
1 changed files with 11 additions and 3 deletions
|
@ -5193,7 +5193,9 @@ void HistoryWidget::updatePinnedViewer() {
|
|||
: (!_migrated || _pinnedClickedId.channel)
|
||||
? _pinnedClickedId.msg
|
||||
: (_pinnedClickedId.msg - ServerMaxMsgId);
|
||||
if (_pinnedClickedId && lessThanId <= lastClickedId) {
|
||||
if (_pinnedClickedId
|
||||
&& lessThanId <= lastClickedId
|
||||
&& !_scrollToAnimation.animating()) {
|
||||
_pinnedClickedId = FullMsgId();
|
||||
}
|
||||
if (_pinnedClickedId && !_minPinnedId) {
|
||||
|
@ -5201,7 +5203,7 @@ void HistoryWidget::updatePinnedViewer() {
|
|||
_peer,
|
||||
_migrated ? _migrated->peer.get() : nullptr);
|
||||
}
|
||||
if (_pinnedClickedId && _minPinnedId == _pinnedClickedId) {
|
||||
if (_pinnedClickedId && _minPinnedId && _minPinnedId >= _pinnedClickedId) {
|
||||
// After click on the last pinned message we should the top one.
|
||||
_pinnedTracker->trackAround(ServerMaxMsgId - 1);
|
||||
} else {
|
||||
|
@ -5314,7 +5316,13 @@ void HistoryWidget::checkPinnedBarState() {
|
|||
const auto id = _pinnedTracker->currentMessageId();
|
||||
if (const auto item = session().data().message(id.message)) {
|
||||
Ui::showPeerHistory(item->history()->peer, item->id);
|
||||
_pinnedClickedId = id.message;
|
||||
if (const auto group = session().data().groups().find(item)) {
|
||||
// Hack for the case when a non-first item of an album
|
||||
// is pinned and we still want the 'show last after first'.
|
||||
_pinnedClickedId = group->items.front()->fullId();
|
||||
} else {
|
||||
_pinnedClickedId = id.message;
|
||||
}
|
||||
_minPinnedId = std::nullopt;
|
||||
updatePinnedViewer();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue