fix: persist control revert to loaded value (#25793)
This commit is contained in:
1 parent
61cee42ded
commit
7572283517
1 file changed
+7
-2
@@ -2948,9 +2948,14 @@
|
|||||||
const loaded = chat?.chat ?? {};
|
const loaded = chat?.chat ?? {};
|
||||||
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
|
if (equal(params, loaded.params ?? {}) && equal(chatFiles, loaded.files ?? [])) return;
|
||||||
|
|
||||||
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
|
const res = await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
|
||||||
console.error('[controls autosave]', err)
|
(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;
|
const MAX_DRAFT_LENGTH = 5000;
|
||||||
|
|||||||
Reference in new issue
Block a user