mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
refac
This commit is contained in:
parent
31a97d8fec
commit
e39617b1c0
@ -2,7 +2,7 @@
|
|||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import { onDestroy, onMount, tick } from 'svelte';
|
import { onDestroy, onMount, tick } from 'svelte';
|
||||||
|
|
||||||
import { showSidebar, socket } from '$lib/stores';
|
import { chatId, showSidebar, socket } from '$lib/stores';
|
||||||
import { getChannelById, getChannelMessages, sendMessage } from '$lib/apis/channels';
|
import { getChannelById, getChannelMessages, sendMessage } from '$lib/apis/channels';
|
||||||
|
|
||||||
import Messages from './Messages.svelte';
|
import Messages from './Messages.svelte';
|
||||||
@ -98,6 +98,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
if ($chatId) {
|
||||||
|
chatId.set('');
|
||||||
|
}
|
||||||
|
|
||||||
$socket?.on('channel-events', channelEventHandler);
|
$socket?.on('channel-events', channelEventHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
const chat = $page.url.pathname.includes(`/c/${event.chat_id}`);
|
const chat = $page.url.pathname.includes(`/c/${event.chat_id}`);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(!(chat || event.chat_id === $chatId) && !$temporaryChatEnabled) ||
|
(event.chat_id !== $chatId && !$temporaryChatEnabled) ||
|
||||||
document.visibilityState !== 'visible'
|
document.visibilityState !== 'visible'
|
||||||
) {
|
) {
|
||||||
await tick();
|
await tick();
|
||||||
|
Loading…
Reference in New Issue
Block a user