Fix type handling of active_character_id

0cdc389794ba53fe924cdc82a806361562d43cc7

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

1 files changed, +2 -3Ignore whitespace
public/scripts/RossAscends-mods.js+2 -3
@@ -280,14 +280,13 @@ async function RA_autoloadchat() {
280 // active character is the name, we should look it up in the character list and get the id280 // active character is the name, we should look it up in the character list and get the id
281 if (active_character !== null && active_character !== undefined) {281 if (active_character !== null && active_character !== undefined) {
282 const active_character_id = characters.findIndex(x => getTagKeyForEntity(x) === active_character);282 const active_character_id = characters.findIndex(x => getTagKeyForEntity(x) === active_character);
283 if (active_character_id !== null) {283 if (active_character_id !== -1) {
284 await selectCharacterById(String(active_character_id));284 await selectCharacterById(String(active_character_id));
285285
286 // Do a little tomfoolery to spoof the tag selector286 // Do a little tomfoolery to spoof the tag selector
287 const selectedCharElement = $(`#rm_print_characters_block .character_select[chid="${active_character_id}"]`);287 const selectedCharElement = $(`#rm_print_characters_block .character_select[chid="${active_character_id}"]`);
288 applyTagsOnCharacterSelect.call(selectedCharElement);288 applyTagsOnCharacterSelect.call(selectedCharElement);
289 }289 } else {
290 if (!active_character_id) {
291 setActiveCharacter(null);290 setActiveCharacter(null);
292 saveSettingsDebounced();291 saveSettingsDebounced();
293 console.warn(`Currently active character with ID ${active_character} not found. Resetting to no active character.`);292 console.warn(`Currently active character with ID ${active_character} not found. Resetting to no active character.`);