mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(web) Add drag n drop upload functionality (#1216)
* Add image drag n drop functionality * Change upload cover name, background color and opacity
This commit is contained in:
parent
6736063f83
commit
10b0924cfb
11 changed files with 159 additions and 177 deletions
|
|
@ -236,25 +236,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
const assetUploadedToAlbumHandler = async (event: CustomEvent) => {
|
||||
const { assetIds }: { assetIds: string[] } = event.detail;
|
||||
try {
|
||||
const { data } = await api.albumApi.addAssetsToAlbum(album.id, {
|
||||
assetIds: assetIds
|
||||
});
|
||||
|
||||
if (data.album) {
|
||||
album = data.album;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error [assetUploadedToAlbumHandler] ', e);
|
||||
notificationController.show({
|
||||
type: NotificationType.Error,
|
||||
message: 'Error adding asset to album, check console for more details'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const addUserHandler = async (event: CustomEvent) => {
|
||||
const { selectedUsers }: { selectedUsers: UserResponseDto[] } = event.detail;
|
||||
|
||||
|
|
@ -591,10 +572,10 @@
|
|||
|
||||
{#if isShowAssetSelection}
|
||||
<AssetSelection
|
||||
albumId={album.id}
|
||||
assetsInAlbum={album.assets}
|
||||
on:go-back={() => (isShowAssetSelection = false)}
|
||||
on:create-album={createAlbumHandler}
|
||||
on:asset-uploaded={assetUploadedToAlbumHandler}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue