diff --git a/public/script.js b/public/script.js index 507791c19..519865dec 100644 --- a/public/script.js +++ b/public/script.js @@ -8553,7 +8553,7 @@ async function doImpersonate(args, prompt) { async function doNewChat({ deleteCurrentChat = false } = {}) { //Make a new chat for selected character - if ((!selected_group && this_chid == undefined) || menu_type != 'create') { + if ((!selected_group && this_chid == undefined) || menu_type == 'create') { return; } diff --git a/public/scripts/bookmarks.js b/public/scripts/bookmarks.js index f099ba047..f6a2d1d70 100644 --- a/public/scripts/bookmarks.js +++ b/public/scripts/bookmarks.js @@ -24,6 +24,7 @@ import { saveGroupBookmarkChat, selected_group, } from './group-chats.js'; +import { Popup } from './popup.js'; import { createTagMapFromList } from './tags.js'; import { @@ -239,8 +240,7 @@ async function convertSoloToGroupChat() { return; } - const confirm = await callPopup('Are you sure you want to convert this chat to a group chat?', 'confirm'); - + const confirm = await Popup.show.confirm('Convert to group chat', 'Are you sure you want to convert this chat to a group chat?
This cannot be reverted.'); if (!confirm) { return; } diff --git a/public/scripts/popup.js b/public/scripts/popup.js index c31824f0b..d2138b722 100644 --- a/public/scripts/popup.js +++ b/public/scripts/popup.js @@ -78,8 +78,8 @@ const showPopupHelper = { /** * Asynchronously displays a confirmation popup with the given header and text, returning the clicked result button value. * - * @param {string} header - The header text for the popup. - * @param {string} text - The main text for the popup. + * @param {string?} header - The header text for the popup. + * @param {string?} text - The main text for the popup. * @param {PopupOptions} [popupOptions={}] - Options for the popup. * @return {Promise} A Promise that resolves with the result of the user's interaction. */ @@ -491,9 +491,17 @@ export class Popup { } class PopupUtils { + /** + * Builds popup content with header and text below + * + * @param {string} header - The header to be added to the text + * @param {string} text - The main text content + */ static BuildTextWithHeader(header, text) { - return ` -

${header}

+ if (!header) { + return text; + } + return `

${header}

${text}`; } }