fix loading EmojiList from server just one time

This commit is contained in:
Milos Holba
2021-02-23 16:58:00 +01:00
parent bf6cd34cf6
commit 595bce60eb
4 changed files with 44 additions and 9 deletions
+10 -4
View File
@@ -151,17 +151,23 @@ export default {
}, 800),
openMenu() {
this.loadedList = false
this.selectOpen = !this.selectOpen
//Load emojis
if (this.selectOpen) {
// Load emojis from server just if not loaded already
if (this.selectOpen && ! this.emojis) {
this.$store.dispatch('getEmojisList').then((loaded) => {
this.loadedList = loaded
})
}
if ( ! this.selectOpen )
this.loadedList = false
// Simulate loading for the emojisList processing
if(this.emojis) {
setTimeout(() => {
this.loadedList = true
}, 20);
}
this.searchInput = ''