mirror of
https://github.com/immich-app/immich.git
synced 2025-12-04 11:49:53 +09:00
fix(web): cannot open detail panel in public shared link (#5946)
* fix(web): cannot open detail panel in public shared link * fix websocket auth message * refactor
This commit is contained in:
@@ -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 { getAuthUser } from '$lib/utils/auth';
|
||||
|
||||
export interface ReleaseEvent {
|
||||
isAvailable: boolean;
|
||||
@@ -23,12 +24,17 @@ export const websocketStore = {
|
||||
|
||||
let websocket: Socket | null = null;
|
||||
|
||||
export const openWebsocketConnection = () => {
|
||||
export const openWebsocketConnection = async () => {
|
||||
try {
|
||||
if (websocket) {
|
||||
return;
|
||||
}
|
||||
|
||||
const user = await getAuthUser();
|
||||
if (!user) {
|
||||
return;
|
||||
}
|
||||
|
||||
websocket = io('', {
|
||||
path: '/api/socket.io',
|
||||
reconnection: true,
|
||||
|
||||
Reference in New Issue
Block a user