mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Better folder / chat closing by escape.
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user