Skip to content

Commit 4fcb692

Browse files
committed
fix: persist control revert to loaded value
1 parent f7aecf6 commit 4fcb692

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
@@ -2860,9 +2860,14 @@
28602860
const loaded = chat?.chat ?? {};
28612861
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
28622862
2863-
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
2864-
console.error('[controls autosave]', err)
2863+
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
2864+
(err) => {
2865+
console.error('[controls autosave]', err);
2866+
return null;
2867+
}
28652868
);
2869+
// Refresh the dedupe baseline so a later revert still saves.
2870+
if (res) chat = res;
28662871
};
28672872
28682873
const MAX_DRAFT_LENGTH = 5000;

0 commit comments

Comments
 (0)