From f856abc80ea7555843b2dc7acf215de71392fe6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?=
=?UTF-8?q?=E3=81=AB=E3=82=85?=
<17376330+u1-liquid@users.noreply.github.com>
Date: Tue, 27 Feb 2024 08:00:55 +0900
Subject: [PATCH] =?UTF-8?q?fix(MkEmojiPicker):=20=E5=89=8A=E9=99=A4?=
=?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=A0?=
=?UTF-8?q?=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=8C=E7=B5=B5=E6=96=87=E5=AD=97?=
=?UTF-8?q?=E3=83=94=E3=83=83=E3=82=AB=E3=83=BC=E3=81=AB=E6=AE=8B=E3=81=A3?=
=?UTF-8?q?=E3=81=A6=E3=82=8B=E3=81=A8=E3=83=94=E3=83=83=E3=82=AB=E3=83=BC?=
=?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=88=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B?=
=?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(MisskeyIO#480)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
+ カスタム絵文字のカテゴリー判定が壊れてる問題を修正
---
.../frontend/src/components/MkEmojiPicker.vue | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue
index 25bb326b8..e7f6f9143 100644
--- a/packages/frontend/src/components/MkEmojiPicker.vue
+++ b/packages/frontend/src/components/MkEmojiPicker.vue
@@ -49,7 +49,7 @@ SPDX-License-Identifier: AGPL-3.0-only
@pointerenter="computeButtonTitle"
@click="chosen(emoji, $event)"
>
-
+
@@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only
@pointerenter="computeButtonTitle"
@click="chosen(emoji, $event)"
>
-
+
@@ -79,8 +79,8 @@ SPDX-License-Identifier: AGPL-3.0-only
v-for="child in customEmojiFolderRoot.children"
:key="`custom:${child.category}`"
:initialShown="false"
- :emojis="computed(() => customEmojis.filter(e => filterCategory(e, child.value)).map(e => `:${e.name}:`))"
- :disabledEmojis="computed(() => customEmojis.filter(e => filterCategory(e, child.value)).filter(e => !canReact(e)).map(e => `:${e.name}:`))"
+ :emojis="computed(() => customEmojis.filter(e => filterCategory(e, child.category)).map(e => `:${e.name}:`))"
+ :disabledEmojis="computed(() => customEmojis.filter(e => filterCategory(e, child.category)).filter(e => !canReact(e)).map(e => `:${e.name}:`))"
:hasChildSection="child.children.length !== 0"
:customEmojiTree="child.children"
@chosen="chosen"
@@ -152,10 +152,10 @@ const {
} = defaultStore.reactiveState;
const recentlyUsedEmojisDef = computed(() => {
- return recentlyUsedEmojis.value.map(getDef);
+ return recentlyUsedEmojis.value.map(getDef).filter(x => x !== null);
});
const pinnedEmojisDef = computed(() => {
- return pinned.value?.map(getDef);
+ return pinned.value?.map(getDef).filter(x => x !== null) ?? [];
});
const pinned = computed(() => props.pinnedEmojis);
@@ -384,9 +384,9 @@ function getKey(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef):
function getDef(emoji: string) {
if (emoji.includes(':')) {
- return customEmojisMap.get(emoji.replace(/:/g, ''))!;
+ return customEmojisMap.get(emoji.replace(/:/g, '')) ?? null;
} else {
- return unicodeEmojisMap.get(emoji)!;
+ return unicodeEmojisMap.get(emoji) ?? null;
}
}