move stickers to emoji store

This commit is contained in:
Henry Jameson 2026-01-29 15:14:17 +02:00
commit 5e21134d9b
4 changed files with 11 additions and 5 deletions

View file

@ -232,7 +232,7 @@ const getStickers = async ({ store }) => {
).sort((a, b) => {
return a.meta.title.localeCompare(b.meta.title)
})
useInstanceStore().set({ name: 'stickers', value: stickers })
useEmojiStore().setStickers(stickers)
} else {
throw res
}

View file

@ -351,8 +351,8 @@ const EmojiPicker = {
return this.showingStickers ? '' : this.activeGroup
},
stickersAvailable() {
if (useInstanceStore().stickers) {
return useInstanceStore().stickers.length > 0
if (useEmojiStore().stickers) {
return useEmojiStore().stickers.length > 0
}
return 0
},
@ -383,7 +383,7 @@ const EmojiPicker = {
.concat(this.unicodeEmojiGroups)
},
stickerPickerEnabled() {
return (useInstanceStore().stickers || []).length !== 0
return (useEmojiStore().stickers || []).length !== 0
},
debouncedHandleKeywordChange() {
return debounce(() => {

View file

@ -17,7 +17,7 @@ const StickerPicker = {
},
computed: {
pack() {
return useInstanceStore().stickers || []
return useEmojiStore().stickers || []
},
},
methods: {

View file

@ -14,6 +14,9 @@ const defaultState = {
emoji: {},
emojiFetched: false,
unicodeEmojiAnnotations: {},
// Stickers
stickers: null
}
const SORTED_EMOJI_GROUP_IDS = [
@ -127,6 +130,9 @@ export const useEmojiStore = defineStore('emoji', {
},
},
actions: {
setStickers (stickers) {
this.stickers = stickers
},
async getStaticEmoji() {
try {
// See build/emojis_plugin for more details