This commit is contained in:
2025-06-08 19:49:32 +02:00
parent 482285abf6
commit 7a8bcca0ef
5 changed files with 59 additions and 11 deletions

View File

@@ -2,11 +2,17 @@
import '../app.css';
import { ModeWatcher } from 'mode-watcher';
import { ChatSocket } from '$lib/socket';
import { onMount } from 'svelte';
import { onMount, type Snippet } from 'svelte';
import { browser } from '$app/environment';
import { setMessageStore } from '$lib/message.svelte';
import type { LayoutServerData } from './$types.js';
let { children } = $props();
interface Props {
children: Snippet;
data: LayoutServerData;
}
let { children, data } = $props();
let socket;
@@ -14,7 +20,7 @@
onMount(() => {
if (browser) {
socket = new ChatSocket('ws://localhost:3000/ws', store);
socket = new ChatSocket(`ws://localhost:3000/ws?token=${data.token}`, store);
}
});
</script>