Skip to content

Commit 40f2eae

Browse files
committed
Make it return empty array on cancel
1 parent 8eee1d0 commit 40f2eae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

public/scripts/slash-commands.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
6969
import { SlashCommandAbortController } from './slash-commands/SlashCommandAbortController.js';
7070
import { SlashCommandNamedArgumentAssignment } from './slash-commands/SlashCommandNamedArgumentAssignment.js';
7171
import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
72-
import { POPUP_TYPE, Popup, callGenericPopup } from './popup.js';
72+
import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup } from './popup.js';
7373
import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
7474
import { SlashCommandBreakController } from './slash-commands/SlashCommandBreakController.js';
7575
import { 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) {
2477-
return JSON.stringify(Array.from(multipleToggledState).map(r => resultToButtonMap.get(r) ?? ''));
2477+
const array = result === POPUP_RESULT.AFFIRMATIVE ? Array.from(multipleToggledState).map(r => resultToButtonMap.get(r) ?? '') : [];
2478+
return JSON.stringify(array);
24782479
}
24792480
return typeof result === 'number' ? resultToButtonMap.get(result) ?? '' : '';
24802481
}

0 commit comments

Comments
 (0)