mirror of
https://github.com/immich-app/immich.git
synced 2025-03-01 15:11:21 +01: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:
parent
45cf3291a2
commit
aaa7a613b2
2 changed files with 10 additions and 4 deletions
|
@ -52,7 +52,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: isOwner = $user.id === asset.ownerId;
|
$: isOwner = $user?.id === asset.ownerId;
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
// Get latest description from server
|
// Get latest description from server
|
||||||
|
@ -356,7 +356,7 @@
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly && $user && asset.ownerId === $user.id}
|
{:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly && isOwner}
|
||||||
<div class="flex justify-between place-items-start gap-4 py-4">
|
<div class="flex justify-between place-items-start gap-4 py-4">
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<div>
|
<div>
|
||||||
|
@ -519,7 +519,7 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{:else if !asset.exifInfo?.city && !asset.isReadOnly && $user && asset.ownerId === $user.id}
|
{:else if !asset.exifInfo?.city && !asset.isReadOnly && isOwner}
|
||||||
<div
|
<div
|
||||||
class="flex justify-between place-items-start gap-4 py-4 rounded-lg hover:dark:text-immich-dark-primary hover:text-immich-primary"
|
class="flex justify-between place-items-start gap-4 py-4 rounded-lg hover:dark:text-immich-dark-primary hover:text-immich-primary"
|
||||||
on:click={() => (isShowChangeLocation = true)}
|
on:click={() => (isShowChangeLocation = true)}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import type { AssetResponseDto, ServerVersionResponseDto } from '@api';
|
||||||
import { Socket, io } from 'socket.io-client';
|
import { Socket, io } from 'socket.io-client';
|
||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import { loadConfig } from './server-config.store';
|
import { loadConfig } from './server-config.store';
|
||||||
|
import { getAuthUser } from '$lib/utils/auth';
|
||||||
|
|
||||||
export interface ReleaseEvent {
|
export interface ReleaseEvent {
|
||||||
isAvailable: boolean;
|
isAvailable: boolean;
|
||||||
|
@ -23,12 +24,17 @@ export const websocketStore = {
|
||||||
|
|
||||||
let websocket: Socket | null = null;
|
let websocket: Socket | null = null;
|
||||||
|
|
||||||
export const openWebsocketConnection = () => {
|
export const openWebsocketConnection = async () => {
|
||||||
try {
|
try {
|
||||||
if (websocket) {
|
if (websocket) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const user = await getAuthUser();
|
||||||
|
if (!user) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
websocket = io('', {
|
websocket = io('', {
|
||||||
path: '/api/socket.io',
|
path: '/api/socket.io',
|
||||||
reconnection: true,
|
reconnection: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue