フォルダ

This commit is contained in:
mattyatea 2023-12-23 11:46:57 +09:00
parent 1f1908870c
commit e5f81c02a1
1 changed files with 4 additions and 3 deletions

View File

@ -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 )
}