mirror of
https://github.com/open-webui/open-webui
synced 2024-12-28 23:02:25 +00:00
refac
This commit is contained in:
parent
b70a31f81e
commit
346856b578
@ -92,7 +92,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const chatEventHandler = async (event) => {
|
const chatEventHandler = async (event) => {
|
||||||
if (event.chat_id !== $chatId) {
|
if (event.chat_id !== $chatId || document.visibilityState !== 'visible') {
|
||||||
await tick();
|
await tick();
|
||||||
const type = event?.data?.type ?? null;
|
const type = event?.data?.type ?? null;
|
||||||
const data = event?.data?.data ?? null;
|
const data = event?.data?.data ?? null;
|
||||||
@ -126,7 +126,7 @@
|
|||||||
// check url path
|
// check url path
|
||||||
const channel = $page.url.pathname.includes(`/channels/${event.channel_id}`);
|
const channel = $page.url.pathname.includes(`/channels/${event.channel_id}`);
|
||||||
|
|
||||||
if (!channel && event?.user?.id !== $user?.id) {
|
if ((!channel || document.visibilityState !== 'visible') && event?.user?.id !== $user?.id) {
|
||||||
await tick();
|
await tick();
|
||||||
const type = event?.data?.type ?? null;
|
const type = event?.data?.type ?? null;
|
||||||
const data = event?.data?.data ?? null;
|
const data = event?.data?.data ?? null;
|
||||||
|
Loading…
Reference in New Issue
Block a user