Change popup cancel result in command to empty str

2385c5a59a4b729224678b1cfe8f8a2eb642974a

Wolfsblvt <wolfsblvt@gmail.com>

2 files changed, +4 -4Showing whitespace changes
public/scripts/popup.js+2 -2
@@ -92,7 +92,7 @@ const showPopupHelper = {
9292 * @param {string?} header - The header text for the popup.
9393 * @param {string?} text - The main text for the popup.
9494 * @param {PopupOptions} [popupOptions={}] - Options for the popup.
9595 * @return {Promise<POPUP_RESULT?>} A Promise that resolves with the result of the user's interaction.
9696 */
9797 confirm: async (header, text, popupOptions = {}) => {
9898 const content = PopupUtils.BuildTextWithHeader(header, text);
@@ -107,7 +107,7 @@ const showPopupHelper = {
107107 * @param {string?} header - The header text for the popup.
108108 * @param {string?} text - The main text for the popup.
109109 * @param {PopupOptions} [popupOptions={}] - Options for the popup.
110110 * @return {Promise<POPUP_RESULT?>} A Promise that resolves with the result of the user's interaction.
111111 */
112112 text: async (header, text, popupOptions = {}) => {
113113 const content = PopupUtils.BuildTextWithHeader(header, text);
public/scripts/slash-commands.js+2 -2
@@ -1308,7 +1308,7 @@ export function initDefaultSlashCommands() {
13081308 }),
13091309 SlashCommandNamedArgument.fromProps({
13101310 name: 'result',
13111311 description: 'if enabled, returns the popup result (as an integer) instead of the popup text. Resolves to 1 for OK and 0/null for cancel orbutton, empty string for exiting out.',
13121312 typeList: [ARGUMENT_TYPE.BOOLEAN],
13131313 enumList: commonEnumProviders.boolean('trueFalse')(),
13141314 defaultValue: 'false',
@@ -1938,7 +1938,7 @@ async function popupCallback(args, value) {
19381938 cancelButton: args?.cancelButton !== undefined && typeof args?.cancelButton === 'string' ? args.cancelButton : null,
19391939 };
19401940 const result = await Popup.show.text(safeHeader, safeBody, popupOptions);
19411941 return String(requestedResult ? result ?? '' : value);
19421942}
19431943
19441944async function getMessagesCallback(args, value) {