Change popup cancel result in command to empty str
| @@ -92,7 +92,7 @@ const showPopupHelper = { | ||
| 92 | 92 | * @param {string?} header - The header text for the popup. |
| 93 | 93 | * @param {string?} text - The main text for the popup. |
| 94 | 94 | * @param {PopupOptions} [popupOptions={}] - Options for the popup. |
| 95 | 95 | * @return {Promise<POPUP_RESULT?>} A Promise that resolves with the result of the user's interaction. |
| 96 | 96 | */ |
| 97 | 97 | confirm: async (header, text, popupOptions = {}) => { |
| 98 | 98 | const content = PopupUtils.BuildTextWithHeader(header, text); |
| @@ -107,7 +107,7 @@ const showPopupHelper = { | ||
| 107 | 107 | * @param {string?} header - The header text for the popup. |
| 108 | 108 | * @param {string?} text - The main text for the popup. |
| 109 | 109 | * @param {PopupOptions} [popupOptions={}] - Options for the popup. |
| 110 | 110 | * @return {Promise<POPUP_RESULT?>} A Promise that resolves with the result of the user's interaction. |
| 111 | 111 | */ |
| 112 | 112 | text: async (header, text, popupOptions = {}) => { |
| 113 | 113 | const content = PopupUtils.BuildTextWithHeader(header, text); |
| @@ -1308,7 +1308,7 @@ export function initDefaultSlashCommands() { | ||
| 1308 | 1308 | }), |
| 1309 | 1309 | SlashCommandNamedArgument.fromProps({ |
| 1310 | 1310 | name: 'result', |
| 1311 | 1311 | 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.', |
| 1312 | 1312 | typeList: [ARGUMENT_TYPE.BOOLEAN], |
| 1313 | 1313 | enumList: commonEnumProviders.boolean('trueFalse')(), |
| 1314 | 1314 | defaultValue: 'false', |
| @@ -1938,7 +1938,7 @@ async function popupCallback(args, value) { | ||
| 1938 | 1938 | cancelButton: args?.cancelButton !== undefined && typeof args?.cancelButton === 'string' ? args.cancelButton : null, |
| 1939 | 1939 | }; |
| 1940 | 1940 | const result = await Popup.show.text(safeHeader, safeBody, popupOptions); |
| 1941 | 1941 | return String(requestedResult ? result ?? '' : value); |
| 1942 | 1942 | } |
| 1943 | 1943 | |
| 1944 | 1944 | async function getMessagesCallback(args, value) { |