2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

In jump-to-date don't clear history stack.

This commit is contained in:
John Preston
2022-07-19 14:29:04 +03:00
parent 58fb14e292
commit bb29773090
3 changed files with 30 additions and 12 deletions

View File

@@ -1441,12 +1441,19 @@ void SessionController::showCalendar(Dialogs::Key chat, QDate requestedDate) {
button->setPointerCursor(false);
}
};
const auto weak = base::make_weak(this);
const auto jump = [=](const QDate &date) {
const auto open = [=](not_null<PeerData*> peer, MsgId id) {
if (const auto strong = weak.get()) {
strong->showPeerHistory(peer, SectionShow::Way::Forward, id);
}
};
session().api().resolveJumpToDate(chat, date, open);
};
show(Box<Ui::CalendarBox>(Ui::CalendarBoxArgs{
.month = highlighted,
.highlighted = highlighted,
.callback = [=](const QDate &date) {
session().api().jumpToDate(chat, date);
},
.callback = [=](const QDate &date) { jump(date); },
.minDate = minPeerDate,
.maxDate = maxPeerDate,
.allowsSelection = history->peer->isUser(),