Fix force flag not being passed

5fca39fae7621c0e4f85ee262c877b0b59cf692d

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

1 files changed, +4 -2Ignore whitespace
public/script.js+4 -2
@@ -6695,7 +6695,7 @@ export function saveChatDebounced() {
66956695 *
66966696 * @returns {Promise<void>}
66976697 */
66986698export async function saveChat({ chatName, withMetadata, mesId, force = false } = {}) {
66996699 const metadata = { ...chat_metadata, ...(withMetadata || {}) };
67006700 const fileName = chatName ?? characters[this_chid]?.chat;
67016701
@@ -6740,6 +6740,7 @@ export async function saveChat({ chatName, withMetadata, mesId, force } = {}) {
67406740 file_name: fileName,
67416741 chat: chatToSave,
67426742 avatar_url: characters[this_chid].avatar,
6743+ force: force,
67436744 }),
67446745 cache: 'no-cache',
67456746 });
@@ -6748,8 +6749,9 @@ export async function saveChat({ chatName, withMetadata, mesId, force } = {}) {
67486749 const errorData = await result.json();
67496750 if (errorData?.error === 'integrity' && !force) {
67506751 const forceSaveConfirmed = await Popup.show.confirm(
67516752 t`Chat integrity check failed, continuing the operation may result in data loss.`,
67526753 t`Would you like to overwrite the chat file anyway? Pressing "NO" will cancel the save operation.`,
6754+ { okButton: t`Yes, overwrite`, cancelButton: t`No, cancel` },
67536755 ) === POPUP_RESULT.AFFIRMATIVE;
67546756
67556757 if (forceSaveConfirmed) {