From e5f81c02a1bb51225513be6682f1a79d487797ab Mon Sep 17 00:00:00 2001 From: mattyatea Date: Sat, 23 Dec 2023 11:46:57 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/MkEmojiPicker.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index ce2e83f042..40776ff653 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -76,7 +76,7 @@ SPDX-License-Identifier: AGPL-3.0-only v-for="child in customEmojiFolderRoot.children" :key="`custom:${child.value}`" :initialShown="false" - :emojis="computed(() => customEmojis.filter(e => child.value === '' ? (e.category === 'null' || !e.category) : e.category === child.value && !e.category || e.category === child.category+'/'+child.category && !e.category).filter(filterAvailable).map(e => `:${e.name}:`))" + :emojis="computed(() => customEmojis.filter(e => child.value === '' ? (e.category === 'null' || !e.category) : e.category === child.value && !customEmojis.some(emoji => emoji.category.includes(e.category+'/')) || e.category === child.category+'/'+child.category && !e.category).filter(filterAvailable).map(e => `:${e.name}:`))" :hasChildSection="child.children.length !== 0" :customEmojiTree="child.children" @chosen="chosen" @@ -158,8 +158,9 @@ const customEmojiFolderRoot: CustomEmojiFolderTree = { value: '', category: '', function parseAndMergeCategories(input: string, root: CustomEmojiFolderTree): CustomEmojiFolderTree { const parts = input.split('/').map(p => p.trim()); // スラッシュで区切って配列にしてる let currentNode: CustomEmojiFolderTree = root; // currentNode は root - - if (parts.length === 1 && parts[0] !== '') { // parts が 1 つで空じゃなかったら + let includesPart = customEmojis.value.some(emoji => emoji.category.includes(parts[0]+'/')) ; + console.log(includesPart) + if (parts.length === 1 && parts[0] !== '' && includesPart) { // parts が 1 つで空じゃなかったら parts.push(parts[0]) // parts に parts[0] を追加 (test category だったら test/test category になる) }