mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix(web): inconsistent asset nav bar state after visiting shared link (#26674)
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
import { navigate } from '$lib/utils/navigation';
|
import { navigate } from '$lib/utils/navigation';
|
||||||
import { sharedLinkLogin, SharedLinkType, type AssetResponseDto, type SharedLinkResponseDto } from '@immich/sdk';
|
import { sharedLinkLogin, SharedLinkType, type AssetResponseDto, type SharedLinkResponseDto } from '@immich/sdk';
|
||||||
import { Button, Logo, PasswordInput } from '@immich/ui';
|
import { Button, Logo, PasswordInput } from '@immich/ui';
|
||||||
import { tick } from 'svelte';
|
import { onDestroy, tick } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -60,6 +60,10 @@
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
await handlePasswordSubmit();
|
await handlePasswordSubmit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
setSharedLink(undefined);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ export const downloadRequest = <TBody = unknown>(options: DownloadRequestOptions
|
|||||||
|
|
||||||
let _sharedLink: SharedLinkResponseDto | undefined;
|
let _sharedLink: SharedLinkResponseDto | undefined;
|
||||||
|
|
||||||
export const setSharedLink = (sharedLink: SharedLinkResponseDto) => (_sharedLink = sharedLink);
|
export const setSharedLink = (sharedLink: typeof _sharedLink) => (_sharedLink = sharedLink);
|
||||||
export const getSharedLink = (): SharedLinkResponseDto | undefined => _sharedLink;
|
export const getSharedLink = (): typeof _sharedLink => _sharedLink;
|
||||||
|
|
||||||
const createUrl = (path: string, parameters?: Record<string, unknown>) => {
|
const createUrl = (path: string, parameters?: Record<string, unknown>) => {
|
||||||
const searchParameters = new URLSearchParams();
|
const searchParameters = new URLSearchParams();
|
||||||
|
|||||||
Reference in New Issue
Block a user