mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-26 08:50:13 +01: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;
|
||||
}
|
||||
|
||||
accountStorage.removeItem(`AlertWI_${character.avatar}`);
|
||||
accountStorage.removeItem(`AlertRegex_${character.avatar}`);
|
||||
accountStorage.removeItem(`mediaWarningShown:${character.avatar}`);
|
||||
delete tag_map[character.avatar];
|
||||
select_rm_info('char_delete', character.name);
|
||||
|
||||
@ -11658,6 +11661,9 @@ jQuery(async function () {
|
||||
eventSource.on(event_types.GROUP_CHAT_DELETED, async (name) => {
|
||||
await deleteItemizedPrompts(name);
|
||||
});
|
||||
eventSource.on(event_types.CHARACTER_DELETED, async() => {
|
||||
|
||||
});
|
||||
|
||||
initCustomSelectedSamplers();
|
||||
});
|
||||
|
@ -105,6 +105,10 @@ class AccountStorage {
|
||||
console.warn(`AccountStorage not ready (trying to remove ${key})`);
|
||||
}
|
||||
|
||||
if (!Object.hasOwn(this.state, key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete this.state[key];
|
||||
saveSettingsDebounced();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user