2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Preload chats in support switch.

This commit is contained in:
John Preston
2022-02-05 18:15:24 +03:00
parent 0aa20b4479
commit d89d8b09da
12 changed files with 200 additions and 12 deletions

View File

@@ -3025,6 +3025,24 @@ void InnerWidget::updateRowCornerStatusShown(
}
}
RowDescriptor InnerWidget::resolveChatNext(RowDescriptor from) const {
const auto row = from.key ? from : _controller->activeChatEntryCurrent();
return row.key
? computeJump(
chatListEntryAfter(row),
JumpSkip::NextOrEnd)
: row;
}
RowDescriptor InnerWidget::resolveChatPrevious(RowDescriptor from) const {
const auto row = from.key ? from : _controller->activeChatEntryCurrent();
return row.key
? computeJump(
chatListEntryBefore(row),
JumpSkip::PreviousOrBegin)
: row;
}
void InnerWidget::setupShortcuts() {
Shortcuts::Requests(
) | rpl::filter([=] {
@@ -3197,7 +3215,7 @@ void InnerWidget::setupShortcuts() {
RowDescriptor InnerWidget::computeJump(
const RowDescriptor &to,
JumpSkip skip) {
JumpSkip skip) const {
auto result = to;
if (result.key) {
const auto down = (skip == JumpSkip::NextOrEnd)