Clear media alerts from storage on character deletion
| @@ -9451,6 +9451,9 @@ export async function deleteCharacter(characterKey, { deleteChats = true } = {}) | ||
| 9451 | 9451 | continue; |
| 9452 | 9452 | } |
| 9453 | 9453 | |
| 9454 | + accountStorage.removeItem(`AlertWI_${character.avatar}`); | |
| 9455 | + accountStorage.removeItem(`AlertRegex_${character.avatar}`); | |
| 9456 | + accountStorage.removeItem(`mediaWarningShown:${character.avatar}`); | |
| 9454 | 9457 | delete tag_map[character.avatar]; |
| 9455 | 9458 | select_rm_info('char_delete', character.name); |
| 9456 | 9459 | |
| @@ -11658,6 +11661,9 @@ jQuery(async function () { | ||
| 11658 | 11661 | eventSource.on(event_types.GROUP_CHAT_DELETED, async (name) => { |
| 11659 | 11662 | await deleteItemizedPrompts(name); |
| 11660 | 11663 | }); |
| 11664 | + eventSource.on(event_types.CHARACTER_DELETED, async() => { | |
| 11665 | + | |
| 11666 | + }); | |
| 11661 | 11667 | |
| 11662 | 11668 | initCustomSelectedSamplers(); |
| 11663 | 11669 | }); |
| @@ -105,6 +105,10 @@ class AccountStorage { | ||
| 105 | 105 | console.warn(`AccountStorage not ready (trying to remove ${key})`); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | + if (!Object.hasOwn(this.state, key)) { | |
| 109 | + return; | |
| 110 | + } | |
| 111 | + | |
| 108 | 112 | delete this.state[key]; |
| 109 | 113 | saveSettingsDebounced(); |
| 110 | 114 | } |