Do not delete selected characters on cancel

This commit is contained in:
artisticMink 2023-11-06 15:56:47 +01:00
parent 581a1e485b
commit a0f828a2da

View File

@ -528,10 +528,14 @@ class BulkEditOverlay {
handleContextMenuDelete = () => { handleContextMenuDelete = () => {
callPopup( callPopup(
popupMessage.deleteChat(this.selectedCharacters.length), null) popupMessage.deleteChat(this.selectedCharacters.length), null)
.then(deleteChats => .then((accept) => {
if (true !== accept) return;
const deleteChats = document.getElementById('del_char_checkbox').checked ?? false;
Promise.all(this.selectedCharacters.map(async characterId => CharacterContextMenu.delete(characterId, deleteChats))) Promise.all(this.selectedCharacters.map(async characterId => CharacterContextMenu.delete(characterId, deleteChats)))
.then(() => getCharacters()) .then(() => getCharacters())
.then(() => this.browseState()) .then(() => this.browseState())}
); );
} }