move stickers to emoji store
This commit is contained in:
parent
573a980512
commit
5e21134d9b
4 changed files with 11 additions and 5 deletions
|
|
@ -232,7 +232,7 @@ const getStickers = async ({ store }) => {
|
||||||
).sort((a, b) => {
|
).sort((a, b) => {
|
||||||
return a.meta.title.localeCompare(b.meta.title)
|
return a.meta.title.localeCompare(b.meta.title)
|
||||||
})
|
})
|
||||||
useInstanceStore().set({ name: 'stickers', value: stickers })
|
useEmojiStore().setStickers(stickers)
|
||||||
} else {
|
} else {
|
||||||
throw res
|
throw res
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -351,8 +351,8 @@ const EmojiPicker = {
|
||||||
return this.showingStickers ? '' : this.activeGroup
|
return this.showingStickers ? '' : this.activeGroup
|
||||||
},
|
},
|
||||||
stickersAvailable() {
|
stickersAvailable() {
|
||||||
if (useInstanceStore().stickers) {
|
if (useEmojiStore().stickers) {
|
||||||
return useInstanceStore().stickers.length > 0
|
return useEmojiStore().stickers.length > 0
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
|
|
@ -383,7 +383,7 @@ const EmojiPicker = {
|
||||||
.concat(this.unicodeEmojiGroups)
|
.concat(this.unicodeEmojiGroups)
|
||||||
},
|
},
|
||||||
stickerPickerEnabled() {
|
stickerPickerEnabled() {
|
||||||
return (useInstanceStore().stickers || []).length !== 0
|
return (useEmojiStore().stickers || []).length !== 0
|
||||||
},
|
},
|
||||||
debouncedHandleKeywordChange() {
|
debouncedHandleKeywordChange() {
|
||||||
return debounce(() => {
|
return debounce(() => {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ const StickerPicker = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
pack() {
|
pack() {
|
||||||
return useInstanceStore().stickers || []
|
return useEmojiStore().stickers || []
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ const defaultState = {
|
||||||
emoji: {},
|
emoji: {},
|
||||||
emojiFetched: false,
|
emojiFetched: false,
|
||||||
unicodeEmojiAnnotations: {},
|
unicodeEmojiAnnotations: {},
|
||||||
|
|
||||||
|
// Stickers
|
||||||
|
stickers: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const SORTED_EMOJI_GROUP_IDS = [
|
const SORTED_EMOJI_GROUP_IDS = [
|
||||||
|
|
@ -127,6 +130,9 @@ export const useEmojiStore = defineStore('emoji', {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
setStickers (stickers) {
|
||||||
|
this.stickers = stickers
|
||||||
|
},
|
||||||
async getStaticEmoji() {
|
async getStaticEmoji() {
|
||||||
try {
|
try {
|
||||||
// See build/emojis_plugin for more details
|
// See build/emojis_plugin for more details
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue