Merge pull request #2685 from SillyTavern/fix-tag-import
Tag import fixed, again. (accepts char avatar key)
This commit is contained in:
commit
9505f6915b
|
@ -445,7 +445,11 @@ export function getTagKeyForEntity(entityOrKey) {
|
|||
}
|
||||
|
||||
// Next lets check if its a valid character or character id, so we can swith it to its tag
|
||||
const character = characters.indexOf(x) >= 0 ? x : characters[x];
|
||||
let character;
|
||||
if (!character && characters.indexOf(x) >= 0) character = x; // Check for char object
|
||||
if (!character && typeof x === 'number') character = characters[x]; // check if its a char id
|
||||
if (!character) character = characters.find(y => y.avatar === x); // check if its a char key
|
||||
|
||||
if (character) {
|
||||
x = character.avatar;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue