Fix tag display issue

This commit is contained in:
simon987 2020-06-19 21:04:45 -04:00
parent dc2e4443c4
commit 74cc898259
3 changed files with 5 additions and 2 deletions

View File

@ -289,6 +289,8 @@ void sist2_index(index_args_t *args) {
void sist2_exec_script(exec_args_t *args) { void sist2_exec_script(exec_args_t *args) {
LogCtx.verbose = TRUE;
char descriptor_path[PATH_MAX]; char descriptor_path[PATH_MAX];
snprintf(descriptor_path, PATH_MAX, "%s/descriptor.json", args->index_path); snprintf(descriptor_path, PATH_MAX, "%s/descriptor.json", args->index_path);
index_descriptor_t desc = read_index_descriptor(descriptor_path); index_descriptor_t desc = read_index_descriptor(descriptor_path);

View File

@ -250,12 +250,13 @@ function addTag(map, tag, id, count) {
let child = { let child = {
id: id, id: id,
text: tags.length !== 1 ? tags[0] : `${tags[0]} (${count})`, text: tags.length !== 1 ? tags[0] : `${tags[0]} (${count})`,
name: tags[0],
children: [] children: []
}; };
let found = false; let found = false;
map.forEach(node => { map.forEach(node => {
if (node.text === child.text) { if (node.name === child.name) {
found = true; found = true;
if (tags.length !== 1) { if (tags.length !== 1) {
addTag(node.children, tags.slice(1).join("."), id, count); addTag(node.children, tags.slice(1).join("."), id, count);

File diff suppressed because one or more lines are too long