feat(web): automatically update user info (#5647)

* use svelte store

* fix: websocket error when not authenticated

* more routes
This commit is contained in:
martin 2023-12-12 17:35:28 +01:00 committed by GitHub
parent cbca69841a
commit c602eaea4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 114 additions and 155 deletions

View file

@ -2,6 +2,7 @@ import type { AssetResponseDto, ServerVersionResponseDto } from '@api';
import { Socket, io } from 'socket.io-client';
import { writable } from 'svelte/store';
import { loadConfig } from './server-config.store';
import { getSavedUser } from './user.store';
export interface ReleaseEvent {
isAvailable: boolean;
@ -25,7 +26,7 @@ let websocket: Socket | null = null;
export const openWebsocketConnection = () => {
try {
if (websocket) {
if (websocket || !getSavedUser()) {
return;
}