mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-02 09:46:38 +00:00
fix: fix emoji search messing up with recents
This commit is contained in:
parent
d49be78417
commit
7aef0e1710
@ -10,7 +10,7 @@ import "./emojiList.js" as EmojiJSON
|
||||
Popup {
|
||||
property var emojiSelected: function () {}
|
||||
property var categories: []
|
||||
property string searchString: searchBox.text
|
||||
property alias searchString: searchBox.text
|
||||
|
||||
id: popup
|
||||
modal: false
|
||||
@ -89,17 +89,21 @@ Popup {
|
||||
categories = newCategories
|
||||
}
|
||||
Connections {
|
||||
id: connectionSettings
|
||||
target: applicationWindow
|
||||
onSettingsLoaded: {
|
||||
connectionSettings.enabled = false
|
||||
// Add recent
|
||||
if (!appSettings.recentEmojis || !appSettings.recentEmojis.length) {
|
||||
return
|
||||
}
|
||||
categories[0] = appSettings.recentEmojis
|
||||
emojiSectionsRepeater.itemAt(0).allEmojis = appSettings.recentEmojis
|
||||
}
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
searchBox.text = ""
|
||||
searchBox.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
|
||||
|
@ -43,10 +43,13 @@ Item {
|
||||
|
||||
onSearchStringLowercaseChanged: {
|
||||
if (emojiSection.searchStringLowercase === "") {
|
||||
this.emojis = modelData
|
||||
this.emojis = allEmojis
|
||||
return
|
||||
}
|
||||
this.emojis = modelData.filter(function (emoji) {
|
||||
if (emoji.empty) {
|
||||
return false
|
||||
}
|
||||
return emoji.name.includes(emojiSection.searchStringLowercase) ||
|
||||
emoji.shortname.includes(emojiSection.searchStringLowercase) ||
|
||||
emoji.aliases.some(a => a.includes(emojiSection.searchStringLowercase))
|
||||
|
Loading…
x
Reference in New Issue
Block a user