Skip to content

Commit 630049a

Browse files
committed
fix: persist control revert to loaded value
1 parent e3fdb42 commit 630049a

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

0 commit comments

Comments
 (0)