This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -109,19 +109,20 @@ function fetch(...args:any):Promise {
109109 // create task ID for receiving progress event
110110 let taskId = getUUID ( )
111111 let options = this || { }
112+ let subscription , subscriptionUpload
112113
113114 let promise = new Promise ( ( resolve , reject ) => {
114115 let [ method , url , headers , body ] = [ ...args ]
115116 let nativeMethodName = Array . isArray ( body ) ? 'fetchBlobForm' : 'fetchBlob'
116117
117118 // on progress event listener
118- let subscription = emitter . addListener ( 'RNFetchBlobProgress' , ( e ) => {
119+ subscription = emitter . addListener ( 'RNFetchBlobProgress' , ( e ) => {
119120 if ( e . taskId === taskId && promise . onProgress ) {
120121 promise . onProgress ( e . written , e . total )
121122 }
122123 } )
123124
124- let subscriptionUpload = emitter . addListener ( 'RNFetchBlobProgress-upload' , ( e ) => {
125+ subscriptionUpload = emitter . addListener ( 'RNFetchBlobProgress-upload' , ( e ) => {
125126 if ( e . taskId === taskId && promise . onUploadProgress ) {
126127 promise . onUploadProgress ( e . written , e . total )
127128 }
You can’t perform that action at this time.
0 commit comments