Better folder / chat closing by escape.

This commit is contained in:
John Preston 2022-11-08 21:20:25 +04:00
parent 4a8b5c3015
commit 66435d5269

View file

@ -2653,12 +2653,16 @@ void MainWidget::handleHistoryBack() {
if (!_dialogs) {
return;
}
const auto historyFromFolder = _history->history()
? _history->history()->folder()
: nullptr;
const auto openedFolder = _controller->openedFolder().current();
const auto rootPeer = _stack.empty()
? _history->peer()
: _stack.front()->peer();
const auto rootHistory = rootPeer
? rootPeer->owner().historyLoaded(rootPeer)
: nullptr;
const auto rootFolder = rootHistory ? rootHistory->folder() : nullptr;
if (!openedFolder
|| historyFromFolder == openedFolder
|| rootFolder == openedFolder
|| _dialogs->isHidden()) {
_controller->showBackFromStack();
_dialogs->setInnerFocus();