Skip to content

Commit c8945af

Browse files
committed
fix: persist control revert to loaded value
1 parent 283505c commit c8945af

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
@@ -2908,9 +2908,14 @@
29082908
const loaded = chat?.chat ?? {};
29092909
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
29102910
2911-
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
2912-
console.error('[controls autosave]', err)
2911+
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
2912+
(err) => {
2913+
console.error('[controls autosave]', err);
2914+
return null;
2915+
}
29132916
);
2917+
// Refresh the dedupe baseline so a later revert still saves.
2918+
if (res) chat = res;
29142919
};
29152920
29162921
const MAX_DRAFT_LENGTH = 5000;

0 commit comments

Comments
 (0)