mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
fix: unsent text in a new chat is gone after leaving the chat or reloading
Text typed into a new chat but not sent showed up as an empty message box after going to another page and back to New Chat, or after reloading the page, and the empty box then overwrote the saved draft so it could not come back. Now the typed text, including a skill picked with $, comes back in the message box. Fixes #33397
This commit is contained in:
parent
2b1fb53f4d
commit
73cb953836
1 changed files with 4 additions and 1 deletions
|
|
@ -2768,7 +2768,8 @@
|
|||
autoScroll = true;
|
||||
|
||||
// resetInput() must stay last: the selected model's defaults override the draft's selection.
|
||||
await restoreChatInput(sessionStorage.getItem('chat-input'));
|
||||
const restored = await restoreChatInput(sessionStorage.getItem('chat-input'));
|
||||
const draftPrompt = prompt;
|
||||
const previousChatId = $chatId;
|
||||
const previousMessageId = history.currentId;
|
||||
await resetInput();
|
||||
|
|
@ -2840,6 +2841,8 @@
|
|||
|
||||
loading = false;
|
||||
await tick();
|
||||
// the input mounts empty once loading ends
|
||||
if (restored) messageInput?.setText(draftPrompt);
|
||||
if (modelSearch) await openModelSelectorWithSearch(modelSearch);
|
||||
|
||||
// Consume one-shot desktop event (e.g. Spotlight query, call shortcut)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue