Skip to content

Commit 05bc485

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: persist control revert to loaded value
1 parent 53bc2c4 commit 05bc485

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/lib/components/chat/Chat.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,9 +2914,14 @@
29142914
const loaded = chat?.chat ?? {};
29152915
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
29162916
2917-
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
2918-
console.error('[controls autosave]', err)
2917+
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
2918+
(err) => {
2919+
console.error('[controls autosave]', err);
2920+
return null;
2921+
}
29192922
);
2923+
// Refresh the dedupe baseline so a later revert still saves.
2924+
if (res) chat = res;
29202925
};
29212926
29222927
const MAX_DRAFT_LENGTH = 5000;

0 commit comments

Comments
 (0)