Make overlay work with legacy bulk delete button

This commit is contained in:
artisticMink 2023-11-05 17:18:46 +01:00
parent 2d42882a4b
commit d2bc1e12c3
2 changed files with 6 additions and 1 deletions

View File

@ -5526,6 +5526,8 @@ export async function getChatsFromFiles(data, isGroupChat) {
* in descending order by file name. Returns `undefined` if the fetch request is unsuccessful.
*/
async function getPastCharacterChats() {
if (!characters.includes(this_chid)) return;
const response = await fetch("/getallchatsofcharacter", {
method: 'POST',
body: JSON.stringify({ avatar_url: characters[this_chid].avatar }),

View File

@ -209,6 +209,7 @@ class BulkEditOverlay {
static characterClass = 'character_select';
static selectModeClass = 'group_overlay_mode_select';
static selectedClass = 'character_selected';
static legacySelectedClass = 'bulk_select_checkbox';
#state = CharacterGroupOverlayState.browse;
#longPress = false;
@ -364,9 +365,11 @@ class BulkEditOverlay {
if (alreadySelected) {
character.classList.remove(BulkEditOverlay.selectedClass);
character.querySelector('.' + BulkEditOverlay.legacySelectedClass).checked = false;
this.dismissCharacter(characterId);
} else {
character.classList.add(BulkEditOverlay.selectedClass);
character.classList.add(BulkEditOverlay.selectedClass)
character.querySelector('.' + BulkEditOverlay.legacySelectedClass).checked = true;
this.selectCharacter(characterId);
}
}