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 {
109
109
// create task ID for receiving progress event
110
110
let taskId = getUUID ( )
111
111
let options = this || { }
112
+ let subscription , subscriptionUpload
112
113
113
114
let promise = new Promise ( ( resolve , reject ) => {
114
115
let [ method , url , headers , body ] = [ ...args ]
115
116
let nativeMethodName = Array . isArray ( body ) ? 'fetchBlobForm' : 'fetchBlob'
116
117
117
118
// on progress event listener
118
- let subscription = emitter . addListener ( 'RNFetchBlobProgress' , ( e ) => {
119
+ subscription = emitter . addListener ( 'RNFetchBlobProgress' , ( e ) => {
119
120
if ( e . taskId === taskId && promise . onProgress ) {
120
121
promise . onProgress ( e . written , e . total )
121
122
}
122
123
} )
123
124
124
- let subscriptionUpload = emitter . addListener ( 'RNFetchBlobProgress-upload' , ( e ) => {
125
+ subscriptionUpload = emitter . addListener ( 'RNFetchBlobProgress-upload' , ( e ) => {
125
126
if ( e . taskId === taskId && promise . onUploadProgress ) {
126
127
promise . onUploadProgress ( e . written , e . total )
127
128
}
You can’t perform that action at this time.
0 commit comments