mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Require to save settings before reloading.
This commit is contained in:
		@@ -40,7 +40,7 @@ export const POPUP_RESULT = {
 | 
			
		||||
 * @property {POPUP_RESULT|number?} [defaultResult=POPUP_RESULT.AFFIRMATIVE] - The default result of this popup when Enter is pressed. Can be changed from `POPUP_RESULT.AFFIRMATIVE`.
 | 
			
		||||
 * @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.
 | 
			
		||||
 * @property {CustomPopupInput[]?} [customInputs=null] - Custom inputs to add to the popup. The display below the content and the input box, one by one.
 | 
			
		||||
 * @property {(popup: Popup) => boolean?} [onClosing=null] - Handler called before the popup closes, return `false` to cancel the close
 | 
			
		||||
 * @property {(popup: Popup) => Promise<boolean?>|boolean?} [onClosing=null] - Handler called before the popup closes, return `false` to cancel the close
 | 
			
		||||
 * @property {(popup: Popup) => void?} [onClose=null] - Handler called after the popup closes, but before the DOM is cleaned up
 | 
			
		||||
 * @property {number?} [cropAspect=null] - Aspect ratio for the crop popup
 | 
			
		||||
 * @property {string?} [cropImage=null] - Image URL to display in the crop popup
 | 
			
		||||
@@ -138,7 +138,7 @@ export class Popup {
 | 
			
		||||
    /** @readonly @type {CustomPopupButton[]|string[]?} */ customButtons;
 | 
			
		||||
    /** @readonly @type {CustomPopupInput[]} */ customInputs;
 | 
			
		||||
 | 
			
		||||
    /** @type {(popup: Popup) => boolean?} */ onClosing;
 | 
			
		||||
    /** @type {(popup: Popup) => Promise<boolean?>|boolean?} */ onClosing;
 | 
			
		||||
    /** @type {(popup: Popup) => void?} */ onClose;
 | 
			
		||||
 | 
			
		||||
    /** @type {POPUP_RESULT|number} */ result;
 | 
			
		||||
@@ -509,7 +509,7 @@ export class Popup {
 | 
			
		||||
        this.result = result;
 | 
			
		||||
 | 
			
		||||
        if (this.onClosing) {
 | 
			
		||||
            const shouldClose = this.onClosing(this);
 | 
			
		||||
            const shouldClose = await this.onClosing(this);
 | 
			
		||||
            if (!shouldClose) {
 | 
			
		||||
                this.#isClosingPrevented = true;
 | 
			
		||||
                // Set values back if we cancel out of closing the popup
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user