Skip to content

Commit ad546bb

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: persist control revert to loaded value
1 parent 15cf0da commit ad546bb

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
@@ -2866,9 +2866,14 @@
28662866
const loaded = chat?.chat ?? {};
28672867
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
28682868
2869-
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
2870-
console.error('[controls autosave]', err)
2869+
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
2870+
(err) => {
2871+
console.error('[controls autosave]', err);
2872+
return null;
2873+
}
28712874
);
2875+
// Refresh the dedupe baseline so a later revert still saves.
2876+
if (res) chat = res;
28722877
};
28732878
28742879
const MAX_DRAFT_LENGTH = 5000;

0 commit comments

Comments
 (0)