Fix force flag not being passed
| @@ -6695,7 +6695,7 @@ export function saveChatDebounced() { | ||
| 6695 | 6695 | * |
| 6696 | 6696 | * @returns {Promise<void>} |
| 6697 | 6697 | */ |
| 6698 | 6698 | export async function saveChat({ chatName, withMetadata, mesId, force = false } = {}) { |
| 6699 | 6699 | const metadata = { ...chat_metadata, ...(withMetadata || {}) }; |
| 6700 | 6700 | const fileName = chatName ?? characters[this_chid]?.chat; |
| 6701 | 6701 | |
| @@ -6740,6 +6740,7 @@ export async function saveChat({ chatName, withMetadata, mesId, force } = {}) { | ||
| 6740 | 6740 | file_name: fileName, |
| 6741 | 6741 | chat: chatToSave, |
| 6742 | 6742 | avatar_url: characters[this_chid].avatar, |
| 6743 | + force: force, | |
| 6743 | 6744 | }), |
| 6744 | 6745 | cache: 'no-cache', |
| 6745 | 6746 | }); |
| @@ -6748,8 +6749,9 @@ export async function saveChat({ chatName, withMetadata, mesId, force } = {}) { | ||
| 6748 | 6749 | const errorData = await result.json(); |
| 6749 | 6750 | if (errorData?.error === 'integrity' && !force) { |
| 6750 | 6751 | const forceSaveConfirmed = await Popup.show.confirm( |
| 6751 | 6752 | t`Chat integrity check failed, continuing the operation may result in data loss.`, |
| 6752 | 6753 | 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` }, | |
| 6753 | 6755 | ) === POPUP_RESULT.AFFIRMATIVE; |
| 6754 | 6756 | |
| 6755 | 6757 | if (forceSaveConfirmed) { |