Fix crash in emoji panel search mode toggle.

This commit is contained in:
John Preston 2023-02-12 15:04:57 +04:00
parent 1da635a5dd
commit 1cb0d7c2dc
1 changed files with 2 additions and 1 deletions

View File

@ -486,6 +486,7 @@ void EmojiListWidget::applyNextSearchQuery() {
return;
}
const auto modeChanged = (_searchMode != searching);
clearSelection();
if (modeChanged) {
_searchMode = searching;
}
@ -493,12 +494,12 @@ void EmojiListWidget::applyNextSearchQuery() {
_searchResults.clear();
_searchCustomIds.clear();
}
clearSelection();
resizeToWidth(width());
update();
if (modeChanged) {
visibleTopBottomUpdated(getVisibleTop(), getVisibleBottom());
}
updateSelected();
};
if (_searchQuery.empty()) {
finish(false);