Fix type errors in BulkEditOverlay
| @@ -101,7 +101,7 @@ class CharacterContextMenu { | |||
| 101 | * @param {number} characterId | 101 | * @param {number} characterId |
| 102 | * @returns {Promise<void>} | 102 | * @returns {Promise<void>} |
| 103 | */ | 103 | */ |
| 104 | static persona = async (characterId) => await convertCharacterToPersona(characterId); | 104 | static persona = async (characterId) => void(await convertCharacterToPersona(characterId)); |
| 105 | 105 | ||
| 106 | /** | 106 | /** |
| 107 | * Delete one or more characters, | 107 | * Delete one or more characters, |
| @@ -342,7 +342,7 @@ class BulkTagPopupHandler { | |||
| 342 | 342 | ||
| 343 | for (const characterId of this.characterIds) { | 343 | for (const characterId of this.characterIds) { |
| 344 | for (const tag of mutualTags) { | 344 | for (const tag of mutualTags) { |
| 345 | removeTagFromMap(tag.id, characterId); | 345 | removeTagFromMap(tag.id, characterId.toString()); |
| 346 | } | 346 | } |
| 347 | } | 347 | } |
| 348 | 348 | ||
| @@ -370,7 +370,7 @@ class BulkEditOverlayState { | |||
| 370 | * Implement a SingletonPattern, allowing access to the group overlay instance | 370 | * Implement a SingletonPattern, allowing access to the group overlay instance |
| 371 | * from everywhere via (new CharacterGroupOverlay()) | 371 | * from everywhere via (new CharacterGroupOverlay()) |
| 372 | * | 372 | * |
| 373 | * @type BulkEditOverlay | 373 | * @type {Readonly<BulkEditOverlay>} |
| 374 | */ | 374 | */ |
| 375 | let bulkEditOverlayInstance = null; | 375 | let bulkEditOverlayInstance = null; |
| 376 | 376 | ||
| @@ -590,7 +590,8 @@ class BulkEditOverlay { | |||
| 590 | this.selectState(); | 590 | this.selectState(); |
| 591 | } else if (this.state === BulkEditOverlayState.select) { | 591 | } else if (this.state === BulkEditOverlayState.select) { |
| 592 | this.#contextMenuOpen = true; | 592 | this.#contextMenuOpen = true; |
| 593 | CharacterContextMenu.show(...this.#getContextMenuPosition(event)); | 593 | const [x, y] = this.#getContextMenuPosition(event); |
| 594 | CharacterContextMenu.show(x, y); | ||
| 594 | } | 595 | } |
| 595 | } | 596 | } |
| 596 | 597 | ||
| @@ -694,7 +695,7 @@ class BulkEditOverlay { | |||
| 694 | const characterId = Number(character.getAttribute('data-chid')); | 695 | const characterId = Number(character.getAttribute('data-chid')); |
| 695 | 696 | ||
| 696 | const select = !this.selectedCharacters.includes(characterId); | 697 | const select = !this.selectedCharacters.includes(characterId); |
| 697 | const legacyBulkEditCheckbox = character.querySelector('.' + BulkEditOverlay.legacySelectedClass); | 698 | const legacyBulkEditCheckbox = /** @type {HTMLInputElement} */ (character.querySelector('.' + BulkEditOverlay.legacySelectedClass)); |
| 698 | 699 | ||
| 699 | if (select) { | 700 | if (select) { |
| 700 | character.classList.add(BulkEditOverlay.selectedClass); | 701 | character.classList.add(BulkEditOverlay.selectedClass); |
| @@ -753,7 +754,8 @@ class BulkEditOverlay { | |||
| 753 | 754 | ||
| 754 | handleContextMenuShow = (event) => { | 755 | handleContextMenuShow = (event) => { |
| 755 | event.preventDefault(); | 756 | event.preventDefault(); |
| 756 | CharacterContextMenu.show(...this.#getContextMenuPosition(event)); | 757 | const [x,y] = this.#getContextMenuPosition(event); |
| 758 | CharacterContextMenu.show(x, y); | ||
| 757 | this.#contextMenuOpen = true; | 759 | this.#contextMenuOpen = true; |
| 758 | }; | 760 | }; |
| 759 | 761 | ||
| @@ -761,6 +763,7 @@ class BulkEditOverlay { | |||
| 761 | let contextMenu = document.getElementById(BulkEditOverlay.contextMenuId); | 763 | let contextMenu = document.getElementById(BulkEditOverlay.contextMenuId); |
| 762 | if (false === contextMenu.contains(event.target)) { | 764 | if (false === contextMenu.contains(event.target)) { |
| 763 | CharacterContextMenu.hide(); | 765 | CharacterContextMenu.hide(); |
| 766 | this.#contextMenuOpen = false; | ||
| 764 | } | 767 | } |
| 765 | }; | 768 | }; |
| 766 | 769 | ||