Log if tags couldn't be imported

This commit is contained in:
Wolfsblvt 2024-08-19 21:45:36 +02:00
parent 9505f6915b
commit df3926bf1a
1 changed files with 5 additions and 1 deletions

View File

@ -726,7 +726,11 @@ async function importTags(character, { importSetting = null } = {}) {
const tagsToImport = tagNamesToImport.map(tag => getTag(tag, { createNew: true }));
const added = addTagsToEntity(tagsToImport, character.avatar);
toastr.success(`Imported tags:<br />${tagsToImport.map(x => x.name).join(', ')}`, 'Importing Tags', { escapeHtml: false });
if (added) {
toastr.success(`Imported tags:<br />${tagsToImport.map(x => x.name).join(', ')}`, 'Importing Tags', { escapeHtml: false });
} else {
toastr.error(`Couldn't import tags:<br />${tagsToImport.map(x => x.name).join(', ')}`, 'Importing Tags', { escapeHtml: false });
}
return added;
}