Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not respecting async after update #289

Open
fabiolucenaribas opened this issue Jun 24, 2023 · 1 comment
Open

It is not respecting async after update #289

fabiolucenaribas opened this issue Jun 24, 2023 · 1 comment

Comments

@fabiolucenaribas
Copy link

When updating to Angular 16, (onFileDrop) stopped respecting async, the problem only happens when it comes from 'dropFiles' function, but when it comes from 'uploadFiles' it works normally

@fabiolucenaribas fabiolucenaribas changed the title It is not respecting async after update angular 16 It is not respecting async after update Jun 25, 2023
@fabiolucenaribas
Copy link
Author

fabiolucenaribas commented Jun 25, 2023

I found out why it used to work and now it doesn't work anymore, I noticed that in the 'checkFile' function
The section was commented:

 // if ("getAsFile" in item) {
 // const file = item.getAsFile();
 // if (file) {
 // this.addToQueue(
 // this.getFakeDropEntry(file)
 // );
 // return;
 // }
 // }

because of this, 'webkitGetAsEntry' is being used, which really seems to me to be the most correct, but using it I am having problems reading the files because it is not respecting the async.

Interestingly, if instead of creating the NgxFileDropEntry directly passing the entry and starting to mount it through the getFakeDropEntry function it works normally, I don't know why, but it works for me

 (entry as unknown as FileSystemFileEntry).file(file =>{
      this.addToQueue(this.getFakeDropEntry((file as File)));
 })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant