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

View file

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