Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion web/src/lib/components/pages/SharedLinkPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { navigate } from '$lib/utils/navigation';
import { sharedLinkLogin, SharedLinkType, type AssetResponseDto, type SharedLinkResponseDto } from '@immich/sdk';
import { Button, Logo, PasswordInput } from '@immich/ui';
import { tick } from 'svelte';
import { onDestroy, tick } from 'svelte';
import { t } from 'svelte-i18n';

type Props = {
Expand Down Expand Up @@ -60,6 +60,10 @@
event.preventDefault();
await handlePasswordSubmit();
};

onDestroy(() => {
setSharedLink(undefined);
});
</script>

<svelte:head>
Expand Down
4 changes: 2 additions & 2 deletions web/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export const downloadRequest = <TBody = unknown>(options: DownloadRequestOptions

let _sharedLink: SharedLinkResponseDto | undefined;

export const setSharedLink = (sharedLink: SharedLinkResponseDto) => (_sharedLink = sharedLink);
export const getSharedLink = (): SharedLinkResponseDto | undefined => _sharedLink;
export const setSharedLink = (sharedLink: typeof _sharedLink) => (_sharedLink = sharedLink);
export const getSharedLink = (): typeof _sharedLink => _sharedLink;

const createUrl = (path: string, parameters?: Record<string, unknown>) => {
const searchParameters = new URLSearchParams();
Expand Down
Loading