File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -548,17 +548,16 @@ var RNFS = {
548548 if ( options . fields && typeof options . fields !== 'object' ) throw new Error ( 'uploadFiles: Invalid value for property `fields`' ) ;
549549 if ( options . method && typeof options . method !== 'string' ) throw new Error ( 'uploadFiles: Invalid value for property `method`' ) ;
550550
551- if ( options . begin ) {
552- subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'UploadBegin' , options . begin ) ) ;
553- }
551+
552+ subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'UploadBegin' , options . begin || function ( ) { } ) ) ;
553+
554554 if ( options . beginCallback && options . beginCallback instanceof Function ) {
555555 // Deprecated
556556 subscriptions. push ( RNFS_NativeEventEmitter . addListener ( 'UploadBegin' , options . beginCallback ) ) ;
557557 }
558558
559- if ( options . progress ) {
560- subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'UploadProgress ', options . progress ) ) ;
561- }
559+ subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'UploadProgress' , options . progress || function ( ) { } ) ) ;
560+
562561 if ( options . progressCallback && options . progressCallback instanceof Function ) {
563562 // Deprecated
564563 subscriptions . push ( RNFS_NativeEventEmitter . addListener ( 'UploadProgress' , options . progressCallback ) ) ;
You can’t perform that action at this time.
0 commit comments