1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

fix(web): multi file upload in albums (#10190)

This commit is contained in:
Michel Heusschen 2024-06-12 12:57:11 +02:00 committed by GitHub
parent 9e5c52b7b7
commit 6260caf649
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,8 +31,8 @@ type FileUploadParam = { multiple?: boolean } & (
| { albumId?: string; assetId?: never }
| { albumId?: never; assetId?: string }
);
export const openFileUploadDialog = async (options?: FileUploadParam) => {
const { albumId, multiple, assetId } = options || { multiple: true };
export const openFileUploadDialog = async (options: FileUploadParam = {}) => {
const { albumId, multiple = true, assetId } = options;
const extensions = await getExtensions();
return new Promise<(string | undefined)[]>((resolve, reject) => {
@ -40,7 +40,7 @@ export const openFileUploadDialog = async (options?: FileUploadParam) => {
const fileSelector = document.createElement('input');
fileSelector.type = 'file';
fileSelector.multiple = !!multiple;
fileSelector.multiple = multiple;
fileSelector.accept = extensions.join(',');
fileSelector.addEventListener('change', (e: Event) => {
const target = e.target as HTMLInputElement;