Make onClose async too

a4ee73a3a7fc86bf2eea3bcea2540b290c3bb152

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -4Showing whitespace changes
public/scripts/popup.js+4 -4
@@ -41,7 +41,7 @@ export const POPUP_RESULT = {
4141 * @property {CustomPopupButton[]|string[]?} [customButtons=null] - Custom buttons to add to the popup. If only strings are provided, the buttons will be added with default options, and their result will be in order from `2` onward.
4242 * @property {CustomPopupInput[]?} [customInputs=null] - Custom inputs to add to the popup. The display below the content and the input box, one by one.
4343 * @property {(popup: Popup) => Promise<boolean?>|boolean?} [onClosing=null] - Handler called before the popup closes, return `false` to cancel the close
4444 * @property {(popup: Popup) => Promise<void?>|void?} [onClose=null] - Handler called after the popup closes, but before the DOM is cleaned up
4545 * @property {number?} [cropAspect=null] - Aspect ratio for the crop popup
4646 * @property {string?} [cropImage=null] - Image URL to display in the crop popup
4747 */
@@ -139,7 +139,7 @@ export class Popup {
139139 /** @readonly @type {CustomPopupInput[]} */ customInputs;
140140
141141 /** @type {(popup: Popup) => Promise<boolean?>|boolean?} */ onClosing;
142142 /** @type {(popup: Popup) => Promise<void?>|void?} */ onClose;
143143
144144 /** @type {POPUP_RESULT|number} */ result;
145145 /** @type {any} */ value;
@@ -547,13 +547,13 @@ export class Popup {
547547 fixToastrForDialogs();
548548
549549 // After the dialog is actually completely closed, remove it from the DOM
550550 runAfterAnimation(this.dlg, async () => {
551551 // Call the close on the dialog
552552 this.dlg.close();
553553
554554 // Run a possible custom handler right before DOM removal
555555 if (this.onClose) {
556556 await this.onClose(this);
557557 }
558558
559559 // Remove it from the dom