fix: persist control revert to loaded value (#25793)

This commit is contained in:
Algorithm5838 authored and GitHub committed 2026-06-29 11:37:30 -05:00
1 parent 61cee42ded
commit 7572283517
1 file changed
+7 -2
+7 -2
View File
@@ -2948,9 +2948,14 @@
const loaded = chat?.chat ?? {};
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
console.error('[controls autosave]', err)
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
(err) => {
console.error('[controls autosave]', err);
return null;
}
);
// Refresh the dedupe baseline so a later revert still saves.
if (res) chat = res;
};
const MAX_DRAFT_LENGTH = 5000;