mirror of
https://github.com/open-webui/open-webui
synced 2025-03-03 02:41:56 +00:00
refac
This commit is contained in:
parent
60247fe18d
commit
cce8f37ada
@ -8,7 +8,7 @@
|
|||||||
import XMark from '$lib/components/icons/XMark.svelte';
|
import XMark from '$lib/components/icons/XMark.svelte';
|
||||||
import MessageInput from './MessageInput.svelte';
|
import MessageInput from './MessageInput.svelte';
|
||||||
import Messages from './Messages.svelte';
|
import Messages from './Messages.svelte';
|
||||||
import { onMount, tick } from 'svelte';
|
import { onDestroy, onMount, tick } from 'svelte';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
|
|
||||||
export let threadId = null;
|
export let threadId = null;
|
||||||
@ -54,6 +54,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const channelEventHandler = async (event) => {
|
const channelEventHandler = async (event) => {
|
||||||
|
console.log(event);
|
||||||
if (event.channel_id === channel.id) {
|
if (event.channel_id === channel.id) {
|
||||||
const type = event?.data?.type ?? null;
|
const type = event?.data?.type ?? null;
|
||||||
const data = event?.data?.data ?? null;
|
const data = event?.data?.data ?? null;
|
||||||
@ -148,6 +149,10 @@
|
|||||||
onMount(() => {
|
onMount(() => {
|
||||||
$socket?.on('channel-events', channelEventHandler);
|
$socket?.on('channel-events', channelEventHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
$socket?.off('channel-events', channelEventHandler);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if channel}
|
{#if channel}
|
||||||
|
Loading…
Reference in New Issue
Block a user