Update popup usage

3a0b4ec41dcd48eea8db92b6ee28e4b3c9495e46

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +6 -8Showing whitespace changes
public/scripts/openai.js+5 -7
@@ -73,7 +73,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
7373import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
7474import { renderTemplateAsync } from './templates.js';
7575import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';
7676import { Popup, POPUP_RESULT, POPUP_TYPE, PopupUtils } from './popup.js';
7777
7878export {
7979 openai_messages_count,
@@ -3525,10 +3525,9 @@ async function onPresetImportFileChange(e) {
35253525 if (shouldConfirm) {
35263526 const textHeader = 'The imported preset contains proxy and/or custom endpoint settings.';
35273527 const textMessage = fields.join('<br>');
35283528 const cancelButton = { text: 'Cancel import', result: POPUP_RESULT.CANCELLED, appendAtEnd: true, action: () => popup.complete(POPUP_RESULT.CANCELLED) };
35293529 const popupOptions = { customButtons: [cancelButton], okButton: 'Remove them', cancelButton: 'Import as-is' };
35303530 const popuppopupResult = newawait Popup(PopupUtils.BuildTextWithHeadershow.confirm(textHeader, textMessage), POPUP_TYPE.CONFIRM, '', popupOptions);
3531- const popupResult = await popup.show();
35323531
35333532 if (popupResult === POPUP_RESULT.CANCELLED) {
35343533 console.log('Import cancelled by user');
@@ -3590,10 +3589,9 @@ async function onExportPresetClick() {
35903589 const shouldConfirm = fieldValues.length > 0;
35913590 const textHeader = 'Your preset contains proxy and/or custom endpoint settings.';
35923591 const textMessage = `<div>Do you want to remove these fields before exporting?</div><br>${DOMPurify.sanitize(fieldValues.join('<br>'))}`;
35933592 const cancelButton = { text: 'Cancel', result: POPUP_RESULT.CANCELLED, appendAtEnd: true, action: () => popup.complete(POPUP_RESULT.CANCELLED) };
35943593 const popupOptions = { customButtons: [cancelButton] };
35953594 const popuppopupResult = newawait Popup(PopupUtils.BuildTextWithHeadershow.confirm(textHeader, textMessage), POPUP_TYPE.CONFIRM, '', popupOptions);
3596- const popupResult = shouldConfirm && await popup.show();
35973595
35983596 if (popupResult === POPUP_RESULT.CANCELLED) {
35993597 console.log('Export cancelled by user');
public/scripts/popup.js+1 -1
@@ -565,7 +565,7 @@ export class Popup {
565565 };
566566}
567567
568568export class PopupUtils {
569569 /**
570570 * Builds popup content with header and text below
571571 *