File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -500,15 +500,21 @@ var RNFS = {
500500 var subscriptions = [ ] ;
501501
502502 if ( options . begin ) {
503- subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'DownloadBegin' , options . begin ) ) ;
503+ subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'DownloadBegin' , ( res ) => {
504+ if ( res . jobId === jobId ) options . begin ( res ) ;
505+ } ) ) ;
504506 }
505507
506508 if ( options . progress ) {
507- subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'DownloadProgress' , options . progress ) ) ;
509+ subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'DownloadProgress' , ( res ) => {
510+ if ( res . jobId === jobId ) options . progress ( res ) ;
511+ } ) ) ;
508512 }
509513
510514 if ( options . resumable ) {
511- subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'DownloadResumable' , options . resumable ) ) ;
515+ subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'DownloadResumable' , ( res ) => {
516+ if ( res . jobId === joibId ) options . resumable ( res ) ;
517+ } ) ) ;
512518 }
513519
514520 var bridgeOptions = {
You can’t perform that action at this time.
0 commit comments