23 / resumable.js

A JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable/restartable uploads via the HTML5 File API.
MIT License
4.65k stars 611 forks source link

addFiles event call sequence #582

Open AndreyZSneg opened 3 years ago

AndreyZSneg commented 3 years ago

I'm submitting a: Bug report Current behavior: Currently our application on addFiles event triggers external api call and after call is executed we call resumable.upload. When file(s) is/are added, but not yet uploaded, and we add new file(s), resumable.upload is called before external api call is made.

Expected behavior addFiles event is triggered, at first external api call is executed and after that resumable.upload is called.

Minimal reproduction of the problem with instructions

Environment

addFiles event code: resumable.on('filesAdded', (files: File[]) => { getAPICallWhichReternSomething(files).then(() => resumable.upload()); });