fix: multiple ws connect

Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
pakintada@gmail.com 2026-04-23 11:37:19 +07:00
parent 230d4abe0c
commit 30f8ab773f
5 changed files with 11 additions and 14 deletions

View file

@ -34,7 +34,7 @@
onAuthStateChanged(auth, async function (s) {
authStore.set(s);
authInitialized.set(true);
authInitialized.set(true);
if (s) {
if (browser && 'cookieStore' in window) await cookieStore.set('logged_in', 'true');
else {
@ -51,10 +51,6 @@
return authStore.subscribe(async function (user) {
// console.log(`store get ${JSON.stringify(user)}`);
if (user != null) {
connectToWebsocket();
}
// reloading permissions
if (get(currentPermissions).length == 0 && user != null) {
// need update