diff --git a/packages/frontend-embed/src/boot.ts b/packages/frontend-embed/src/boot.ts index 0130dc8e89..1a5b35482e 100644 --- a/packages/frontend-embed/src/boot.ts +++ b/packages/frontend-embed/src/boot.ts @@ -11,6 +11,7 @@ import { createApp, defineAsyncComponent } from 'vue'; import lightTheme from '@@/themes/l-light.json5'; import darkTheme from '@@/themes/d-dark.json5'; import { applyTheme } from './theme.js'; +import { fetchCustomEmojis } from './custom-emojis.js'; import { setIframeId } from '@/post-message.js'; import { parseEmbedParams } from '@/embed-page.js'; @@ -36,6 +37,10 @@ function setIframeIdHandler(event: MessageEvent) { window.addEventListener('message', setIframeIdHandler); +try { + await fetchCustomEmojis(); +} catch (err) { /* empty */ } + const app = createApp( defineAsyncComponent(() => import('@/ui.vue')), ); diff --git a/packages/frontend-embed/src/custom-emojis.ts b/packages/frontend-embed/src/custom-emojis.ts index fad373fe4c..f6cfe6c506 100644 --- a/packages/frontend-embed/src/custom-emojis.ts +++ b/packages/frontend-embed/src/custom-emojis.ts @@ -19,15 +19,6 @@ function set(key: string, value: any) { const storageCache = await get('emojis'); export const customEmojis = shallowRef(Array.isArray(storageCache) ? storageCache : []); -export const customEmojiCategories = computed<[ ...string[], null ]>(() => { - const categories = new Set(); - for (const emoji of customEmojis.value) { - if (emoji.category && emoji.category !== 'null') { - categories.add(emoji.category); - } - } - return markRaw([...Array.from(categories), null]); -}); export const customEmojisMap = new Map(); watch(customEmojis, emojis => {