markmarijnissen / cordova-file-cache

An awesome File Cache for Cordova Apps.
MIT License
87 stars 29 forks source link

Duplicate progressEvent fired for last item in queue #32

Open mix3d opened 7 years ago

mix3d commented 7 years ago

Because the onprogress event gets fired for every downloaded file, AND again just 4 lines later, the last item gets a progress event twice. No need for this second one; I would remove it.

in the onDone inner function in FileCache.download, after

self.list().then(function(){ 
    // final progress event!
    if(onSingleDownloadProgress) onSingleDownloadProgress(new ProgressEvent());

    // etc...
}