diff --git a/CHANGELOG.md b/CHANGELOG.md index 15028e700..6ce43b12d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,19 @@ --> +## 202x.x.x (unreleased) + +### General +- + +### Client +- Fix: 絵文字関係の不具合を修正 (#13485) + - 履歴に残っている or ピン留めされた絵文字がコントロールパネルより削除されていた際にリアクションデッキが表示できなくなる + - Unicode絵文字が履歴に残っている or ピン留めされているとリアクションデッキが表示できなくなる + +### Server +- + ## 2024.3.0 ### General diff --git a/packages/frontend/src/components/MkAutocomplete.vue b/packages/frontend/src/components/MkAutocomplete.vue index cae6bc711..2f3855266 100644 --- a/packages/frontend/src/components/MkAutocomplete.vue +++ b/packages/frontend/src/components/MkAutocomplete.vue @@ -77,7 +77,7 @@ const emojiDb = computed(() => { unicodeEmojiDB.push({ emoji: emoji, name: k, - aliasOf: getEmojiName(emoji)!, + aliasOf: getEmojiName(emoji), url: char2path(emoji), }); } diff --git a/packages/frontend/src/components/MkEmojiPicker.section.vue b/packages/frontend/src/components/MkEmojiPicker.section.vue index c295ab6bb..012972d8e 100644 --- a/packages/frontend/src/components/MkEmojiPicker.section.vue +++ b/packages/frontend/src/components/MkEmojiPicker.section.vue @@ -87,7 +87,7 @@ const shown = ref(!!props.initialShown); function computeButtonTitle(ev: MouseEvent): void { const elm = ev.target as HTMLElement; const emoji = elm.dataset.emoji as string; - elm.title = getEmojiName(emoji) ?? emoji; + elm.title = getEmojiName(emoji); } function nestedChosen(emoji: any, ev: MouseEvent) { diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 06243e5b0..e30d5969d 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -353,7 +353,7 @@ watch(q, () => { searchResultUnicode.value = Array.from(searchUnicode()); }); -function canReact(emoji: Misskey.entities.EmojiSimple | UnicodeEmojiDef): boolean { +function canReact(emoji: Misskey.entities.EmojiSimple | UnicodeEmojiDef | string): boolean { return !props.targetNote || checkReactionPermissions($i!, props.targetNote, emoji); } @@ -378,11 +378,14 @@ function getKey(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef): return typeof emoji === 'string' ? emoji : 'char' in emoji ? emoji.char : `:${emoji.name}:`; } -function getDef(emoji: string) { +function getDef(emoji: string): string | Misskey.entities.EmojiSimple | UnicodeEmojiDef { if (emoji.includes(':')) { - return customEmojisMap.get(emoji.replace(/:/g, ''))!; + // カスタム絵文字が存在する場合はその情報を持つオブジェクトを返し、 + // サーバの管理画面から削除された等で情報が見つからない場合は名前の文字列をそのまま返しておく(undefinedを返すとエラーになるため) + const name = emoji.replaceAll(':', ''); + return customEmojisMap.get(name) ?? emoji; } else { - return getUnicodeEmoji(emoji)!; + return getUnicodeEmoji(emoji); } } @@ -390,7 +393,7 @@ function getDef(emoji: string) { function computeButtonTitle(ev: MouseEvent): void { const elm = ev.target as HTMLElement; const emoji = elm.dataset.emoji as string; - elm.title = getEmojiName(emoji) ?? emoji; + elm.title = getEmojiName(emoji); } function chosen(emoji: any, ev?: MouseEvent) { diff --git a/packages/frontend/src/components/MkReactionsViewer.details.vue b/packages/frontend/src/components/MkReactionsViewer.details.vue index 3158ba436..8b5e6efdf 100644 --- a/packages/frontend/src/components/MkReactionsViewer.details.vue +++ b/packages/frontend/src/components/MkReactionsViewer.details.vue @@ -44,7 +44,7 @@ function getReactionName(reaction: string): string { if (trimLocal.startsWith(':')) { return trimLocal; } - return getEmojiName(reaction) ?? reaction; + return getEmojiName(reaction); } diff --git a/packages/frontend/src/components/global/MkEmoji.vue b/packages/frontend/src/components/global/MkEmoji.vue index ba4026f0f..65f75642b 100644 --- a/packages/frontend/src/components/global/MkEmoji.vue +++ b/packages/frontend/src/components/global/MkEmoji.vue @@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only