mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-24 00:39:32 +09:00
wip
This commit is contained in:
parent
e41ba1d177
commit
9ea7f21a95
@ -11,6 +11,7 @@ import { createApp, defineAsyncComponent } from 'vue';
|
|||||||
import lightTheme from '@@/themes/l-light.json5';
|
import lightTheme from '@@/themes/l-light.json5';
|
||||||
import darkTheme from '@@/themes/d-dark.json5';
|
import darkTheme from '@@/themes/d-dark.json5';
|
||||||
import { applyTheme } from './theme.js';
|
import { applyTheme } from './theme.js';
|
||||||
|
import { fetchCustomEmojis } from './custom-emojis.js';
|
||||||
import { setIframeId } from '@/post-message.js';
|
import { setIframeId } from '@/post-message.js';
|
||||||
import { parseEmbedParams } from '@/embed-page.js';
|
import { parseEmbedParams } from '@/embed-page.js';
|
||||||
|
|
||||||
@ -36,6 +37,10 @@ function setIframeIdHandler(event: MessageEvent) {
|
|||||||
|
|
||||||
window.addEventListener('message', setIframeIdHandler);
|
window.addEventListener('message', setIframeIdHandler);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await fetchCustomEmojis();
|
||||||
|
} catch (err) { /* empty */ }
|
||||||
|
|
||||||
const app = createApp(
|
const app = createApp(
|
||||||
defineAsyncComponent(() => import('@/ui.vue')),
|
defineAsyncComponent(() => import('@/ui.vue')),
|
||||||
);
|
);
|
||||||
|
@ -19,15 +19,6 @@ function set(key: string, value: any) {
|
|||||||
|
|
||||||
const storageCache = await get('emojis');
|
const storageCache = await get('emojis');
|
||||||
export const customEmojis = shallowRef<Misskey.entities.EmojiSimple[]>(Array.isArray(storageCache) ? storageCache : []);
|
export const customEmojis = shallowRef<Misskey.entities.EmojiSimple[]>(Array.isArray(storageCache) ? storageCache : []);
|
||||||
export const customEmojiCategories = computed<[ ...string[], null ]>(() => {
|
|
||||||
const categories = new Set<string>();
|
|
||||||
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<string, Misskey.entities.EmojiSimple>();
|
export const customEmojisMap = new Map<string, Misskey.entities.EmojiSimple>();
|
||||||
watch(customEmojis, emojis => {
|
watch(customEmojis, emojis => {
|
||||||
|
Loading…
Reference in New Issue
Block a user