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

@ -49,10 +49,10 @@
let socket = get(socketStore);
try {
if (socket) {
socket.close(1000, 'logout');
}
} catch (e) {}
socket?.close(1000, 'logout');
} catch (e) {
console.log('error on disconnect', e);
}
socketStore.set(null);
if (browser && 'cookieStore' in window) await cookieStore.delete('logged_in');