diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-26 16:04:56 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-26 16:04:56 +0900 |
| commit | d106fb39abf8fe17c00e562c1237fcacfe158345 (patch) | |
| tree | 5600e668f6048868f94958a722ab3bbe9cb078de /packages/client/src/components/global | |
| parent | :art: (diff) | |
| download | sharkey-d106fb39abf8fe17c00e562c1237fcacfe158345.tar.gz sharkey-d106fb39abf8fe17c00e562c1237fcacfe158345.tar.bz2 sharkey-d106fb39abf8fe17c00e562c1237fcacfe158345.zip | |
feat: introduce fluent emoji
Diffstat (limited to 'packages/client/src/components/global')
| -rw-r--r-- | packages/client/src/components/global/MkEmoji.vue | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/client/src/components/global/MkEmoji.vue b/packages/client/src/components/global/MkEmoji.vue index 419850d007..ce1299a39f 100644 --- a/packages/client/src/components/global/MkEmoji.vue +++ b/packages/client/src/components/global/MkEmoji.vue @@ -9,7 +9,7 @@ import { computed } from 'vue'; import { CustomEmoji } from 'misskey-js/built/entities'; import { getStaticImageUrl } from '@/scripts/get-static-image-url'; -import { char2filePath } from '@/scripts/twemoji-base'; +import { char2twemojiFilePath, char2fluentEmojiFilePath } from '@/scripts/emoji-base'; import { defaultStore } from '@/store'; import { instance } from '@/instance'; import { getEmojiName } from '@/scripts/emojilist'; @@ -22,14 +22,16 @@ const props = defineProps<{ isReaction?: boolean; }>(); +const char2path = defaultStore.state.emojiStyle === 'twemoji' ? char2twemojiFilePath : char2fluentEmojiFilePath; + const isCustom = computed(() => props.emoji.startsWith(':')); const char = computed(() => isCustom.value ? undefined : props.emoji); -const useOsNativeEmojis = computed(() => defaultStore.state.useOsNativeEmojis && !props.isReaction); +const useOsNativeEmojis = computed(() => defaultStore.state.emojiStyle === 'native' && !props.isReaction); const ce = computed(() => props.customEmojis ?? instance.emojis ?? []); const customEmoji = computed(() => isCustom.value ? ce.value.find(x => x.name === props.emoji.substr(1, props.emoji.length - 2)) : undefined); const url = computed(() => { if (char.value) { - return char2filePath(char.value); + return char2path(char.value); } else { const rawUrl = (customEmoji.value as CustomEmoji).url; return defaultStore.state.disableShowingAnimatedImages |