Skip to content

Commit 9408678

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: persist control revert to loaded value
1 parent 0c74000 commit 9408678

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
@@ -2863,9 +2863,14 @@
28632863
const loaded = chat?.chat ?? {};
28642864
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
28652865
2866-
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
2867-
console.error('[controls autosave]', err)
2866+
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
2867+
(err) => {
2868+
console.error('[controls autosave]', err);
2869+
return null;
2870+
}
28682871
);
2872+
// Refresh the dedupe baseline so a later revert still saves.
2873+
if (res) chat = res;
28692874
};
28702875
28712876
const MAX_DRAFT_LENGTH = 5000;

0 commit comments

Comments
 (0)