Skip to content

Commit

Permalink
remove unnecessary getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Van De Putte committed Feb 5, 2024
1 parent e60a1ad commit efb9ca0
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions ember-file-upload/src/components/file-dropzone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export default class FileDropzoneComponent extends Component<FileDropzoneSignatu
return this.args.multiple ?? true;
}

get allowFolderDrop() {
return this.args.allowFolderDrop ?? false;
}

get files(): File[] {
const files = this.dataTransferWrapper?.files ?? [];
if (this.multiple) return files;
Expand Down Expand Up @@ -223,12 +219,9 @@ export default class FileDropzoneComponent extends Component<FileDropzoneSignatu
// }

if (this.dataTransferWrapper) {
let files;
if (this.allowFolderDrop) {
files = await this.dataTransferWrapper.getFilesAndDirectories();
} else {
files = this.files;
}
const files = this.args.allowFolderDrop ?
await this.dataTransferWrapper.getFilesAndDirectories() :
this.files;

const addedFiles = this.addFiles(files);
this.args.onDrop?.(addedFiles, this.dataTransferWrapper);
Expand Down

0 comments on commit efb9ca0

Please sign in to comment.