mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 11:00:39 +00:00
fix loading EmojiList from server just one time
This commit is contained in:
@@ -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 = ''
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
pickedEmoji () {
|
||||
// If is color not seted send picked emoji via props to EmojiPicker for the EmojiSelected input
|
||||
return !this.selectedColor ? this.selectedEmoji : ''
|
||||
// If is color not selected and emoji is selected, push picked emoji to EmojiPicker for the EmojiSelected input
|
||||
return !this.selectedColor && this.selectedEmoji ? this.selectedEmoji : ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
methods: {
|
||||
setIcon(value) {
|
||||
|
||||
// Set emoji
|
||||
// Set color
|
||||
this.selectedColor = value.color
|
||||
|
||||
this.selectedEmoji = undefined
|
||||
@@ -94,6 +94,9 @@ export default {
|
||||
this.selectedEmoji = icon.value.emoji
|
||||
this.selectedColor = undefined
|
||||
}
|
||||
|
||||
// If want to set default folder icon from emoji, set selectedEmoji to undefined
|
||||
icon.value === 'default' ? this.selectedEmoji = undefined : ''
|
||||
})
|
||||
|
||||
// If folder have already set some color set this color to selected color
|
||||
|
||||
Reference in New Issue
Block a user