This commit is contained in:
meronmks 2023-10-30 12:09:56 +09:00
parent 45e39bd6d4
commit 84ed25a1fd
No known key found for this signature in database
1 changed files with 2 additions and 6 deletions

View File

@ -156,14 +156,10 @@ 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 (let part of parts) {
if (!part) {
part = '';
}
for (const part of parts) {
let existingNode = currentNode.children.find((node) => node.value === part);
if (!existingNode) {