Skip to content

Commit 407f395

Browse files
committed
use dropzoneInst.addFile
1 parent c9e72c4 commit 407f395

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web_src/js/features/comp/EditorUpload.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '../dropzone.ts';
1010
import type CodeMirror from 'codemirror';
1111
import type EasyMDE from 'easymde';
12+
import type {DropzoneFile} from 'dropzone';
1213

1314
let uploadIdCounter = 0;
1415

@@ -30,8 +31,8 @@ function uploadFile(dropzoneEl: HTMLElement, file: File) {
3031
}
3132
};
3233
dropzoneInst.on(DropzoneCustomEventUploadDone, onUploadDone);
33-
// @ts-expect-error - bug in @types/dropzone
34-
dropzoneInst.handleFiles([file]);
34+
// this is not entirely correct because File does not satisfy DropzoneFile
35+
dropzoneInst.addFile(file as DropzoneFile);
3536
});
3637
}
3738

0 commit comments

Comments
 (0)