From 8484c9d4320562ab066b0b9e5a40a9a2213c1b9a Mon Sep 17 00:00:00 2001 From: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com> Date: Sun, 7 Jun 2026 09:32:47 +0300 Subject: [PATCH] fix: persist control revert to loaded value --- 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 69652dbe41..8bb44a0c00 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2855,9 +2855,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;