feat: add retry connect socket, close when logged out
Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
c876847eff
commit
4866674f26
2 changed files with 21 additions and 3 deletions
|
|
@ -14,6 +14,7 @@
|
|||
import * as adb from '$lib/core/adb/adb';
|
||||
import { browser } from '$app/environment';
|
||||
import { deleteCookiesOnNonBrowser } from '$lib/helpers/cookie';
|
||||
import { socketStore } from '$lib/core/stores/websocketStore';
|
||||
|
||||
const sidebar = useSidebar();
|
||||
|
||||
|
|
@ -44,6 +45,13 @@
|
|||
}
|
||||
|
||||
authStore.set(null);
|
||||
|
||||
let socket = get(socketStore);
|
||||
if (socket) {
|
||||
socket.close(1011, 'logout');
|
||||
}
|
||||
|
||||
socketStore.set(null);
|
||||
if (browser && 'cookieStore' in window) await cookieStore.delete('logged_in');
|
||||
else deleteCookiesOnNonBrowser('logged_in');
|
||||
await auth.signOut();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue