fix(StatusEmojiPopup): fix initial loading of recent emojis

the "Recent emojis" was always empty until the user has clicked
additional emoji

loading the recent emojis in `Global.onSettingsLoaded` is too late; it's
executed long before the popup is opened; instead do it at the end of
parsing the categories
This commit is contained in:
Lukáš Tinkl 2022-09-01 12:02:21 +02:00 committed by Lukáš Tinkl
parent d30c80ef24
commit 65a1f06382
1 changed files with 3 additions and 12 deletions

View File

@ -183,19 +183,10 @@ Popup {
}
categories = newCategories;
}
Connections {
id: connectionSettings
target: Global
onSettingsLoaded: {
connectionSettings.enabled = false
// Add recent
if (!localAccountSensitiveSettings.recentEmojis || !localAccountSensitiveSettings.recentEmojis.length) {
return
}
categories[0] = localAccountSensitiveSettings.recentEmojis
emojiSectionsRepeater.itemAt(0).allEmojis = localAccountSensitiveSettings.recentEmojis
const recent = localAccountSensitiveSettings.recentEmojis;
if (!!recent) {
emojiSectionsRepeater.itemAt(0).allEmojis = recent;
}
}