enh/refac: debounce chat draft save

This commit is contained in:
Timothy Jaeryang Baek
2025-07-31 16:02:43 +04:00
parent 05895d9657
commit 73b07df28f
2 changed files with 28 additions and 18 deletions
+2 -9
View File
@@ -55,6 +55,7 @@
export let webSearchEnabled = false;
export let onSelect = (e) => {};
export let onChange = (e) => {};
export let toolServers = [];
@@ -224,15 +225,7 @@
{stopResponse}
{createMessagePair}
placeholder={$i18n.t('How can I help you today?')}
onChange={(input) => {
if (!$temporaryChatEnabled) {
if (input.prompt !== null) {
sessionStorage.setItem(`chat-input`, JSON.stringify(input));
} else {
sessionStorage.removeItem(`chat-input`);
}
}
}}
{onChange}
on:upload={(e) => {
dispatch('upload', e.detail);
}}