diff --git a/web/src/lib/components/album-page/album-viewer.svelte b/web/src/lib/components/album-page/album-viewer.svelte index 4d327d322b..1183af14d6 100644 --- a/web/src/lib/components/album-page/album-viewer.svelte +++ b/web/src/lib/components/album-page/album-viewer.svelte @@ -2,9 +2,10 @@ import { browser } from '$app/environment'; import { afterNavigate, goto } from '$app/navigation'; import { albumAssetSelectionStore } from '$lib/stores/album-asset-selection.store'; + import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store'; import { downloadAssets } from '$lib/stores/download'; import { locale } from '$lib/stores/preferences.store'; - import { openFileUploadDialog } from '$lib/utils/file-uploader'; + import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader'; import { AlbumResponseDto, AssetResponseDto, @@ -80,6 +81,13 @@ $: isPublicShared = sharedLink; $: isOwned = currentUser?.id == album.ownerId; + dragAndDropFilesStore.subscribe((value) => { + if (value.isDragging && value.files.length > 0) { + fileUploadHandler(value.files, album.id, sharedLink?.key); + dragAndDropFilesStore.set({ isDragging: false, files: [] }); + } + }); + let multiSelectAsset: Set = new Set(); $: isMultiSelectionMode = multiSelectAsset.size > 0; diff --git a/web/src/lib/components/share-page/individual-shared-viewer.svelte b/web/src/lib/components/share-page/individual-shared-viewer.svelte index a6a50f091a..65d0bcea55 100644 --- a/web/src/lib/components/share-page/individual-shared-viewer.svelte +++ b/web/src/lib/components/share-page/individual-shared-viewer.svelte @@ -1,8 +1,9 @@ @@ -76,7 +83,7 @@ {/if} - +