fix: case too many connection on websocket
Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
a10dbbf26c
commit
c876847eff
3 changed files with 37 additions and 6 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue