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

This commit is contained in:
Algorithm5838
2026-06-29 19:37:30 +03:00
committed by GitHub
parent 61cee42ded
commit 7572283517
+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;