From 09a9ab98305e86daf98c52f0c5e6482863b29073 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: Sun, 29 Oct 2023 21:25:44 +0900 Subject: [PATCH] fix --- packages/frontend/src/components/MkEmojiPicker.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 8ea826fb3fd0..9d96ed3de69d 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -156,14 +156,11 @@ const tab = ref<'index' | 'custom' | 'unicode' | 'tags'>('index'); const customEmojiFolderRoot: CustomEmojiFolderTree = { value: "", category: "", children: [] }; function parseAndMergeCategories(input: string, root: CustomEmojiFolderTree): CustomEmojiFolderTree { - const parts = input.split('/'); + const parts = input.split('/').map(p => p.trim()); let currentNode: CustomEmojiFolderTree = root; for (const part of parts) { - if (!part) continue; - let existingNode = currentNode.children.find((node) => node.value === part); - if (!existingNode) { const newNode: CustomEmojiFolderTree = { value: part, category: input, children: [] }; currentNode.children.push(newNode);