fix: case too many connection on websocket

Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
pakintada@gmail.com 2026-02-26 12:49:08 +07:00
parent a10dbbf26c
commit c876847eff
3 changed files with 37 additions and 6 deletions

View file

@ -7,8 +7,20 @@
import '../layout.css';
import ErrorLayout from '$lib/components/error-layout.svelte';
import { sidebarStore } from '$lib/core/stores/sidebar';
import { onMount } from 'svelte';
import { auth } from '$lib/core/stores/auth';
import { get } from 'svelte/store';
import { connectToWebsocket } from '$lib/core/stores/websocketStore';
let { children } = $props();
onMount(() => {
let currentUser = get(auth);
console.log(`on mount layout current user: ${JSON.stringify(currentUser)}`);
if (currentUser) {
connectToWebsocket();
}
});
</script>
<svelte:head>