mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-18 04:43:55 +00:00
fix: refreshing a new chat with Landing Page Mode set to Chat no longer throws a TypeError (#32510)
With Settings > Interface > Landing Page Mode set to Chat, the new chat page renders the message list, so the block that reveals a message picked from search ran there too. With no chat open, chat?.id and $page.params.id are both undefined, the guard passed, and chat.id threw "can't access property 'id'" on every refresh. Require a chat before comparing its id with the page's.
This commit is contained in:
parent
a575875cc3
commit
5d4f16bcc9
1 changed files with 1 additions and 1 deletions
|
|
@ -1225,7 +1225,7 @@
|
|||
};
|
||||
|
||||
let revealedSearchMessage = '';
|
||||
$: if (!embedded && !loading && messagesRef && chat?.id === $page.params.id) {
|
||||
$: if (!embedded && !loading && messagesRef && chat && chat.id === $page.params.id) {
|
||||
const target = $page.url.searchParams.get('message');
|
||||
const key = `${chat.id}:${target}`;
|
||||
if (target && history.messages[target] && key !== revealedSearchMessage) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue