Show toast about jump-to non-existent message.

This commit is contained in:
John Preston 2022-02-28 19:46:16 +03:00
parent 71228eae59
commit 282b3592c2
2 changed files with 4 additions and 0 deletions

View file

@ -1195,6 +1195,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_message_empty" = "Empty Message";
"lng_message_unsupported" = "This message is not supported by your version of Telegram Desktop. Please update to the latest version in Settings, or install it from {link}";
"lng_message_not_found" = "Message doesn't exist.";
"lng_duration_seconds#one" = "{count} second";
"lng_duration_seconds#other" = "{count} seconds";

View file

@ -5155,6 +5155,9 @@ int HistoryWidget::countInitialScrollTop() {
const auto itemTop = _list->itemTop(item);
if (itemTop < 0) {
setMsgId(0);
Ui::ShowMultilineToast({
.text = { tr::lng_message_not_found(tr::now) },
});
return countInitialScrollTop();
} else {
const auto view = item->mainView();