カテゴリ末尾が / の場合ピッカーから消失するので「その他」と扱い対応
This commit is contained in:
parent
0ae2d136e5
commit
2e05560358
|
@ -160,21 +160,25 @@ function parseAndMergeCategories(input: string, root: CustomEmojiFolderTree): Cu
|
||||||
let category = "";
|
let category = "";
|
||||||
let currentNode: CustomEmojiFolderTree = root;
|
let currentNode: CustomEmojiFolderTree = root;
|
||||||
|
|
||||||
for (const part of parts) {
|
for (let part of parts) {
|
||||||
if (part) {
|
if (part) {
|
||||||
category += `/${part}`;
|
category += `/${part}`;
|
||||||
category = category.replace(/^\//, '');
|
} else {
|
||||||
let existingNode = currentNode.children.find((node) => node.value === part);
|
part = i18n.ts.other
|
||||||
|
category += `/`;
|
||||||
|
}
|
||||||
|
|
||||||
if (!existingNode) {
|
category = category.replace(/^\//, '');
|
||||||
const newNode: CustomEmojiFolderTree = { value: part, category, children: [] };
|
let existingNode = currentNode.children.find((node) => node.value === part);
|
||||||
currentNode.children.push(newNode);
|
|
||||||
existingNode = newNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentNode = existingNode;
|
if (!existingNode) {
|
||||||
}
|
const newNode: CustomEmojiFolderTree = { value: part, category, children: [] };
|
||||||
}
|
currentNode.children.push(newNode);
|
||||||
|
existingNode = newNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentNode = existingNode;
|
||||||
|
}
|
||||||
|
|
||||||
return currentNode;
|
return currentNode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue