diff --git a/packages/frontend/src/components/MkEmojiPicker.section.vue b/packages/frontend/src/components/MkEmojiPicker.section.vue index fda847bef..6f99fa920 100644 --- a/packages/frontend/src/components/MkEmojiPicker.section.vue +++ b/packages/frontend/src/components/MkEmojiPicker.section.vue @@ -29,6 +29,19 @@ SPDX-License-Identifier: AGPL-3.0-only
(:{{ customEmojiTree.length }} :{{ emojis.length }})
+
+ + {{ child.value || i18n.ts.other }} + +
-
- - {{ child.value || i18n.ts.other }} - -
diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 9d96ed3de..9ebd35217 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -156,13 +156,19 @@ 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('/').map(p => p.trim()); + const parts = (input && input !== 'null' ? input : '').split('/'); let currentNode: CustomEmojiFolderTree = root; for (const part of parts) { - let existingNode = currentNode.children.find((node) => node.value === part); + const path = currentNode.value ? `${currentNode.value}/${part.trim()}` : part.trim(); + + let existingNode = currentNode.children.find((node) => node.value === path); if (!existingNode) { - const newNode: CustomEmojiFolderTree = { value: part, category: input, children: [] }; + const newNode: CustomEmojiFolderTree = { + value: path, + category: currentNode.category ? `${currentNode.category}/${part}` : part, + children: [], + }; currentNode.children.push(newNode); existingNode = newNode; }