From ee13cef37f16f771ffeca6fad654bab14236c133 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 10 Mar 2025 01:37:25 +0200 Subject: [PATCH 1/2] Fix group creation inheriting tags from characters[0] --- public/scripts/tags.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/scripts/tags.js b/public/scripts/tags.js index badb1ee8c..93ba99f70 100644 --- a/public/scripts/tags.js +++ b/public/scripts/tags.js @@ -1259,11 +1259,11 @@ export function applyTagsOnCharacterSelect(chid = null) { if (menu_type === 'create') { const currentTagIds = $('#tagList').find('.tag').map((_, el) => $(el).attr('id')).get(); const currentTags = tags.filter(x => currentTagIds.includes(x.id)); - printTagList($('#tagList'), { forEntityOrKey: null, tags: currentTags, tagOptions: { removable: true } }); + printTagList($('#tagList'), { forEntityOrKey: undefined, tags: currentTags, tagOptions: { removable: true } }); return; } - chid = chid ?? Number(this_chid); + chid = chid ?? (this_chid !== undefined ? Number(this_chid) : undefined); printTagList($('#tagList'), { forEntityOrKey: chid, tagOptions: { removable: true } }); } @@ -1272,11 +1272,11 @@ export function applyTagsOnGroupSelect(groupId = null) { if (menu_type === 'group_create') { const currentTagIds = $('#groupTagList').find('.tag').map((_, el) => $(el).attr('id')).get(); const currentTags = tags.filter(x => currentTagIds.includes(x.id)); - printTagList($('#groupTagList'), { forEntityOrKey: null, tags: currentTags, tagOptions: { removable: true } }); + printTagList($('#groupTagList'), { forEntityOrKey: undefined, tags: currentTags, tagOptions: { removable: true } }); return; } - groupId = groupId ?? Number(selected_group); + groupId = groupId ?? (selected_group ? Number(selected_group) : undefined); printTagList($('#groupTagList'), { forEntityOrKey: groupId, tagOptions: { removable: true } }); } From a3b2cc456fafe431165dc9b2c290845a380dd4f4 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 10 Mar 2025 20:30:03 +0200 Subject: [PATCH 2/2] Clear group tags list on create click --- public/scripts/tags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/tags.js b/public/scripts/tags.js index 93ba99f70..ce6ef89f6 100644 --- a/public/scripts/tags.js +++ b/public/scripts/tags.js @@ -1251,7 +1251,7 @@ function onCharacterCreateClick() { } function onGroupCreateClick() { - // Nothing to do here at the moment. Tags in group interface get automatically redrawn. + $('#groupTagList').empty(); } export function applyTagsOnCharacterSelect(chid = null) {