diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index c022fe13..ef14ec00 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -331,7 +331,7 @@ _customEmojiPreview: text: "ノート文面" textDescription: "追加したカスタム絵文字は{emoji_id}で参照できます。" _placeholder: - noteText: "カスタム絵文字はこんな感じで表示されます→ :emoji_preview_0:\n文章を書き換えて、使い勝手を試してみてくださいね✨" + noteText: "カスタム絵文字はこんな感じで表示されます→ :emoji_preview_1:\n文章を書き換えて、使い勝手を試してみてくださいね✨" _api: _permissions: diff --git a/pages/tools/custom-emoji-preview.vue b/pages/tools/custom-emoji-preview.vue index e6b09eb3..07883886 100644 --- a/pages/tools/custom-emoji-preview.vue +++ b/pages/tools/custom-emoji-preview.vue @@ -83,7 +83,6 @@ import PlusIco from 'bi/plus-lg.svg'; import XIco from 'bi/x-lg.svg'; import SunIco from 'bi/sun.svg'; import MoonIco from 'bi/moon.svg'; -import { on } from 'events'; definePageMeta({ layout: 'tools', @@ -100,7 +99,7 @@ const emojis = ref<{ file: string | Blob; invertColorScheme: boolean; }[]>([{ - id: 0, + id: 1, file: '/img/emojis/rocket_3d.png', invertColorScheme: false, }]); @@ -114,6 +113,8 @@ const noteReactions = computed(() => emojis.value?.map((emoji) => ({ const customEmojisDefinition = computed(() => Object.fromEntries(noteReactions.value?.map((emoji) => [ emoji.code, emoji.url ]) ?? [])); +const nextId = computed(() => Math.max(0, ...emojis.value.map((emoji) => emoji.id)) + 1); + function deleteEmoji(index: number) { emojis.value.splice(index, 1); } @@ -133,7 +134,7 @@ function addEmoji() { if (!file) return; emojis.value.push({ - id: emojis.value.length, + id: nextId.value, file, invertColorScheme: false, });