mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-07 23:51:09 +02:00
Clear media alerts from storage on character deletion
This commit is contained in:
parent
d5bdf1cb90
commit
ee101353d8
@ -9451,6 +9451,9 @@ export async function deleteCharacter(characterKey, { deleteChats = true } = {})
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
accountStorage.removeItem(`AlertWI_${character.avatar}`);
|
||||||
|
accountStorage.removeItem(`AlertRegex_${character.avatar}`);
|
||||||
|
accountStorage.removeItem(`mediaWarningShown:${character.avatar}`);
|
||||||
delete tag_map[character.avatar];
|
delete tag_map[character.avatar];
|
||||||
select_rm_info('char_delete', character.name);
|
select_rm_info('char_delete', character.name);
|
||||||
|
|
||||||
@ -11658,6 +11661,9 @@ jQuery(async function () {
|
|||||||
eventSource.on(event_types.GROUP_CHAT_DELETED, async (name) => {
|
eventSource.on(event_types.GROUP_CHAT_DELETED, async (name) => {
|
||||||
await deleteItemizedPrompts(name);
|
await deleteItemizedPrompts(name);
|
||||||
});
|
});
|
||||||
|
eventSource.on(event_types.CHARACTER_DELETED, async() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
initCustomSelectedSamplers();
|
initCustomSelectedSamplers();
|
||||||
});
|
});
|
||||||
|
@ -105,6 +105,10 @@ class AccountStorage {
|
|||||||
console.warn(`AccountStorage not ready (trying to remove ${key})`);
|
console.warn(`AccountStorage not ready (trying to remove ${key})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Object.hasOwn(this.state, key)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
delete this.state[key];
|
delete this.state[key];
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user