From 4ea29c0d6198e44a84aae01475b003c8bc192e5b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 3 Nov 2026 09:04:51 +0900 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index c2247d19f3..20b13b781b 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2788,7 +2788,9 @@ autoScroll = true; // resetInput() must stay last: the selected model's defaults override the draft's selection. - await restoreChatInput(sessionStorage.getItem('chat-input')); + const chatInputPrompt = (await restoreChatInput(sessionStorage.getItem('chat-input'))) + ? prompt + : null; const previousChatId = $chatId; const previousMessageId = history.currentId; await resetInput(); @@ -2860,6 +2862,8 @@ loading = false; await tick(); + // Mounting the editor clears prompt, so apply the saved text afterward. + if (chatInputPrompt !== null) messageInput?.setText(chatInputPrompt); if (modelSearch) await openModelSelectorWithSearch(modelSearch); // Consume one-shot desktop event (e.g. Spotlight query, call shortcut)