2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fixed forum closing with Back mouse button.

- Fixed #25330.
This commit is contained in:
23rd
2022-11-10 21:42:15 +03:00
committed by John Preston
parent 561e3f4809
commit efc0908ed8

View File

@@ -2657,14 +2657,21 @@ void MainWidget::handleHistoryBack() {
return;
}
const auto openedFolder = _controller->openedFolder().current();
const auto rootPeer = _stack.empty()
const auto openedForum = _controller->openedForum().current();
const auto rootPeer = !_stack.empty()
? _stack.front()->peer()
: _history->peer()
? _history->peer()
: _stack.front()->peer();
: _mainSection
? _mainSection->activeChat().key.peer()
: nullptr;
const auto rootHistory = rootPeer
? rootPeer->owner().historyLoaded(rootPeer)
: nullptr;
const auto rootFolder = rootHistory ? rootHistory->folder() : nullptr;
if (!openedFolder
if (openedForum && !rootPeer) {
_controller->closeForum();
} else if (!openedFolder
|| rootFolder == openedFolder
|| _dialogs->isHidden()) {
_controller->showBackFromStack();