Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Don't prevent default before you're sure there's a file.
Browse files Browse the repository at this point in the history
Fixes #14.
  • Loading branch information
MadaraUchiha committed Jul 20, 2019
1 parent 23c3418 commit 879d26e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/BetterImageUploadsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ export class BetterImageUploadsModule {
}

private async handleDrop(e: DragEvent) {
e.preventDefault();
const file = this.extractFile(() => e.dataTransfer!);

if (!file) {
return;
}
e.preventDefault();

const url = await this.uploadFile(file);
this.appendToInput(url);
Expand Down

0 comments on commit 879d26e

Please sign in to comment.