From 5fca39fae7621c0e4f85ee262c877b0b59cf692d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 16 Mar 2025 21:39:31 +0200 Subject: [PATCH] Fix force flag not being passed --- public/script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index acb9a54ef..7ce29ce55 100644 --- a/public/script.js +++ b/public/script.js @@ -6695,7 +6695,7 @@ export function saveChatDebounced() { * * @returns {Promise} */ -export async function saveChat({ chatName, withMetadata, mesId, force } = {}) { +export async function saveChat({ chatName, withMetadata, mesId, force = false } = {}) { const metadata = { ...chat_metadata, ...(withMetadata || {}) }; const fileName = chatName ?? characters[this_chid]?.chat; @@ -6740,6 +6740,7 @@ export async function saveChat({ chatName, withMetadata, mesId, force } = {}) { file_name: fileName, chat: chatToSave, avatar_url: characters[this_chid].avatar, + force: force, }), cache: 'no-cache', }); @@ -6748,8 +6749,9 @@ export async function saveChat({ chatName, withMetadata, mesId, force } = {}) { const errorData = await result.json(); if (errorData?.error === 'integrity' && !force) { const forceSaveConfirmed = await Popup.show.confirm( - t`Chat integrity check failed, operation may result in data loss.`, + t`Chat integrity check failed, continuing the operation may result in data loss.`, t`Would you like to overwrite the chat file anyway? Pressing "NO" will cancel the save operation.`, + { okButton: t`Yes, overwrite`, cancelButton: t`No, cancel` }, ) === POPUP_RESULT.AFFIRMATIVE; if (forceSaveConfirmed) {