Fix closing filter by escape.

This commit is contained in:
John Preston 2020-03-27 12:39:47 +04:00
parent 5dfbec17cd
commit 7ea364e611
1 changed files with 5 additions and 2 deletions

View File

@ -684,13 +684,16 @@ void Widget::animationCallback() {
void Widget::escape() { void Widget::escape() {
if (controller()->openedFolder().current()) { if (controller()->openedFolder().current()) {
controller()->closeFolder(); controller()->closeFolder();
} else if (!onCancelSearch() } else if (!onCancelSearch()) {
|| (!_searchInChat && !App::main()->selectingPeer())) {
if (controller()->activeChatEntryCurrent().key) { if (controller()->activeChatEntryCurrent().key) {
emit cancelled(); emit cancelled();
} else if (controller()->activeChatsFilterCurrent()) { } else if (controller()->activeChatsFilterCurrent()) {
controller()->setActiveChatsFilter(FilterId(0)); controller()->setActiveChatsFilter(FilterId(0));
} }
} else if (!_searchInChat && !App::main()->selectingPeer()) {
if (controller()->activeChatEntryCurrent().key) {
emit cancelled();
}
} }
} }