Merge pull request #2685 from SillyTavern/fix-tag-import Tag import fixed, again. (accepts char avatar key)

9505f6915b1d434ae7738cc7f5577a7302d3f5b8

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

Signed
1 files changed, +5 -1Ignore whitespace
public/scripts/tags.js+5 -1
@@ -445,7 +445,11 @@ export function getTagKeyForEntity(entityOrKey) {
445 }445 }
446446
447 // Next lets check if its a valid character or character id, so we can swith it to its tag447 // Next lets check if its a valid character or character id, so we can swith it to its tag
448 const character = characters.indexOf(x) >= 0 ? x : characters[x];448 let character;
449 if (!character && characters.indexOf(x) >= 0) character = x; // Check for char object
450 if (!character && typeof x === 'number') character = characters[x]; // check if its a char id
451 if (!character) character = characters.find(y => y.avatar === x); // check if its a char key
452
449 if (character) {453 if (character) {
450 x = character.avatar;454 x = character.avatar;
451 }455 }