mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
fix: opening or reloading the new chat page shows no model and ignores URL parameters (#33459)
Opening or reloading the new chat page or a folder's page showed "Select a model" in place of the default model, ignored URL parameters such as models=, model= and q= (which fills in the message), and a message sent from there got no reply. Now the default model or the one from the URL is selected and the URL parameters apply, whether you open the page directly or come from another chat. Opening the Inbox and coming back still keeps the typed message and the chosen model. Fixes #33457
This commit is contained in:
parent
4ea29c0d61
commit
082df44d92
1 changed files with 10 additions and 2 deletions
|
|
@ -1962,6 +1962,10 @@
|
|||
});
|
||||
}
|
||||
|
||||
if ($page.url.pathname === '/' || $page.url.pathname.startsWith('/folders/')) {
|
||||
tick().then(initNewChat);
|
||||
}
|
||||
|
||||
// the artifacts pane reads this list when it opens, which can be before the debounced rebuild
|
||||
const showArtifactsSubscribe = showArtifacts.subscribe((value) => {
|
||||
if (value) getContents();
|
||||
|
|
@ -2494,8 +2498,12 @@
|
|||
return () => bridge?.end();
|
||||
});
|
||||
// Only real navigation resets the chat; shallow sidebar state changes must preserve it.
|
||||
afterNavigate(async ({ to }) => {
|
||||
if (to?.url.pathname === '/' || to?.url.pathname.startsWith('/folders/')) {
|
||||
afterNavigate(async ({ from, to }) => {
|
||||
// A navigation that mounts this page starts its new chat in onMount.
|
||||
if (
|
||||
from?.route.id === to?.route.id &&
|
||||
(to?.url.pathname === '/' || to?.url.pathname.startsWith('/folders/'))
|
||||
) {
|
||||
await tick();
|
||||
initNewChat();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue