From 51e05988bd371b1741d38559121595baedbc20a3 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 16 Jun 2025 12:46:04 +0400 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 16 +++++++++------- src/lib/components/chat/Placeholder.svelte | 10 ++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 0d0cddd1f..661c00206 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2121,13 +2121,15 @@ {stopResponse} {createMessagePair} onChange={(input) => { - if (input.prompt !== null) { - localStorage.setItem( - `chat-input${$chatId ? `-${$chatId}` : ''}`, - JSON.stringify(input) - ); - } else { - localStorage.removeItem(`chat-input${$chatId ? `-${$chatId}` : ''}`); + if (!$temporaryChatEnabled) { + if (input.prompt !== null) { + localStorage.setItem( + `chat-input${$chatId ? `-${$chatId}` : ''}`, + JSON.stringify(input) + ); + } else { + localStorage.removeItem(`chat-input${$chatId ? `-${$chatId}` : ''}`); + } } }} on:upload={async (e) => { diff --git a/src/lib/components/chat/Placeholder.svelte b/src/lib/components/chat/Placeholder.svelte index e201608db..41cea8a0f 100644 --- a/src/lib/components/chat/Placeholder.svelte +++ b/src/lib/components/chat/Placeholder.svelte @@ -216,10 +216,12 @@ {createMessagePair} placeholder={$i18n.t('How can I help you today?')} onChange={(input) => { - if (input.prompt !== null) { - localStorage.setItem(`chat-input`, JSON.stringify(input)); - } else { - localStorage.removeItem(`chat-input`); + if (!$temporaryChatEnabled) { + if (input.prompt !== null) { + localStorage.setItem(`chat-input`, JSON.stringify(input)); + } else { + localStorage.removeItem(`chat-input`); + } } }} on:upload={(e) => {