From 757228351756b773f89393ecca8007da1abbe4e4 Mon Sep 17 00:00:00 2001 From: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com> Date: Mon, 29 Jun 2026 19:37:30 +0300 Subject: [PATCH] fix: persist control revert to loaded value (#25793) --- src/lib/components/chat/Chat.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index ec550fb61b..715aeb985c 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -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;