Fix group creation inheriting tags from characters[0]

ee13cef37f16f771ffeca6fad654bab14236c133

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -4Showing whitespace changes
public/scripts/tags.js+4 -4
@@ -1259,11 +1259,11 @@ export function applyTagsOnCharacterSelect(chid = null) {
1259 if (menu_type === 'create') {1259 if (menu_type === 'create') {
1260 const currentTagIds = $('#tagList').find('.tag').map((_, el) => $(el).attr('id')).get();1260 const currentTagIds = $('#tagList').find('.tag').map((_, el) => $(el).attr('id')).get();
1261 const currentTags = tags.filter(x => currentTagIds.includes(x.id));1261 const currentTags = tags.filter(x => currentTagIds.includes(x.id));
1262 printTagList($('#tagList'), { forEntityOrKey: null, tags: currentTags, tagOptions: { removable: true } });1262 printTagList($('#tagList'), { forEntityOrKey: undefined, tags: currentTags, tagOptions: { removable: true } });
1263 return;1263 return;
1264 }1264 }
12651265
1266 chid = chid ?? Number(this_chid);1266 chid = chid ?? (this_chid !== undefined ? Number(this_chid) : undefined);
1267 printTagList($('#tagList'), { forEntityOrKey: chid, tagOptions: { removable: true } });1267 printTagList($('#tagList'), { forEntityOrKey: chid, tagOptions: { removable: true } });
1268}1268}
12691269
@@ -1272,11 +1272,11 @@ export function applyTagsOnGroupSelect(groupId = null) {
1272 if (menu_type === 'group_create') {1272 if (menu_type === 'group_create') {
1273 const currentTagIds = $('#groupTagList').find('.tag').map((_, el) => $(el).attr('id')).get();1273 const currentTagIds = $('#groupTagList').find('.tag').map((_, el) => $(el).attr('id')).get();
1274 const currentTags = tags.filter(x => currentTagIds.includes(x.id));1274 const currentTags = tags.filter(x => currentTagIds.includes(x.id));
1275 printTagList($('#groupTagList'), { forEntityOrKey: null, tags: currentTags, tagOptions: { removable: true } });1275 printTagList($('#groupTagList'), { forEntityOrKey: undefined, tags: currentTags, tagOptions: { removable: true } });
1276 return;1276 return;
1277 }1277 }
12781278
1279 groupId = groupId ?? Number(selected_group);1279 groupId = groupId ?? (selected_group ? Number(selected_group) : undefined);
1280 printTagList($('#groupTagList'), { forEntityOrKey: groupId, tagOptions: { removable: true } });1280 printTagList($('#groupTagList'), { forEntityOrKey: groupId, tagOptions: { removable: true } });
1281}1281}
12821282