mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Fix(web): drag n drop shared link (#3030)
* add event to trigger uploadhandler * add dragndrop store to handle upload in album-viewer and individuel-shared-viewer (only on shares) * fix handleUploadAssets no parameter * fix format
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
import type { PageData } from './$types';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
const { sharedLink } = data;
|
||||
|
||||
let album: AlbumResponseDto | null = null;
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
import AppleHeader from '$lib/components/shared-components/apple-header.svelte';
|
||||
import FaviconHeader from '$lib/components/shared-components/favicon-header.svelte';
|
||||
|
||||
import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store';
|
||||
|
||||
let showNavigationLoadingBar = false;
|
||||
export let data: LayoutData;
|
||||
let albumId: string | undefined;
|
||||
|
||||
beforeNavigate(() => {
|
||||
showNavigationLoadingBar = true;
|
||||
@@ -33,10 +36,14 @@
|
||||
}
|
||||
|
||||
const filesArray: File[] = Array.from<File>(files);
|
||||
const albumId =
|
||||
($page.route.id === '/(user)/albums/[albumId]' || undefined) && $page.params.albumId;
|
||||
albumId = ($page.route.id === '/(user)/albums/[albumId]' || undefined) && $page.params.albumId;
|
||||
|
||||
await fileUploadHandler(filesArray, albumId);
|
||||
const isShare = $page.route.id === '/(user)/share/[key]' || undefined;
|
||||
if (isShare) {
|
||||
dragAndDropFilesStore.set({ isDragging: true, files: filesArray });
|
||||
} else {
|
||||
await fileUploadHandler(filesArray, albumId);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -76,7 +83,7 @@
|
||||
<NavigationLoadingBar />
|
||||
{/if}
|
||||
|
||||
<slot />
|
||||
<slot {albumId} />
|
||||
|
||||
<DownloadPanel />
|
||||
<UploadPanel />
|
||||
|
||||
Reference in New Issue
Block a user