Make it return empty array on cancel

40f2eae3f3297856d799c5789d3fcc3e67e25be8

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +3 -2Showing whitespace changes
public/scripts/slash-commands.js+3 -2
@@ -69,7 +69,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
6969import { SlashCommandAbortController } from './slash-commands/SlashCommandAbortController.js';
7070import { SlashCommandNamedArgumentAssignment } from './slash-commands/SlashCommandNamedArgumentAssignment.js';
7171import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
7272import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup } from './popup.js';
7373import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
7474import { SlashCommandBreakController } from './slash-commands/SlashCommandBreakController.js';
7575import { SlashCommandExecutionError } from './slash-commands/SlashCommandExecutionError.js';
@@ -2474,7 +2474,8 @@ async function buttonsCallback(args, text) {
24742474 /** @returns {string} @param {string|number|boolean} result */
24752475 function getResult(result) {
24762476 if (multiple) {
24772477 returnconst JSONarray = result === POPUP_RESULT.stringify(AFFIRMATIVE ? Array.from(multipleToggledState).map(r => resultToButtonMap.get(r) ?? '')) : [];
2478+ return JSON.stringify(array);
24782479 }
24792480 return typeof result === 'number' ? resultToButtonMap.get(result) ?? '' : '';
24802481 }