mirror of
https://github.com/immich-app/immich.git
synced 2026-04-24 18:19:51 -04:00
dont use onMount
This commit is contained in:
parent
7efafd9db1
commit
57e1b172dd
@ -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 { onDestroy, onMount, tick } from 'svelte';
|
||||
import { onDestroy, tick } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
type Props = {
|
||||
@ -36,6 +36,10 @@
|
||||
let isOwned = $derived(authManager.authenticated && authManager.user.id === sharedLink?.userId);
|
||||
let password = $state('');
|
||||
|
||||
if (passwordRequired) {
|
||||
assetViewerManager.showAssetViewer(false);
|
||||
}
|
||||
|
||||
const handlePasswordSubmit = async () => {
|
||||
try {
|
||||
sharedLink = await sharedLinkLogin({ key, slug, sharedLinkLoginDto: { password } });
|
||||
@ -60,12 +64,6 @@
|
||||
await handlePasswordSubmit();
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
if (passwordRequired) {
|
||||
assetViewerManager.showAssetViewer(false);
|
||||
}
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
setSharedLink(undefined);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user