Clear saved messages tags on cancel search.

This commit is contained in:
John Preston 2024-05-20 14:40:10 +04:00
parent b21bcb86cc
commit fce520c9c0
1 changed files with 4 additions and 1 deletions

View File

@ -3623,7 +3623,9 @@ bool Widget::cancelSearch() {
auto updatedState = _searchState;
const auto clearingQuery = !updatedState.query.isEmpty();
auto clearingInChat = !clearingQuery
&& (updatedState.inChat || updatedState.fromPeer);
&& (updatedState.inChat
|| updatedState.fromPeer
|| !updatedState.tags.empty());
if (clearingQuery) {
updatedState.query = QString();
} else if (clearingInChat) {
@ -3636,6 +3638,7 @@ bool Widget::cancelSearch() {
}
updatedState.inChat = {};
updatedState.fromPeer = nullptr;
updatedState.tags = {};
}
if (!clearingQuery
&& _subsectionTopBar