This repository was archived by the owner on Nov 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
core/src/plugins/uploader.html/js/react Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 396
396
} . bind ( this ) ) ;
397
397
} else {
398
398
UploadTask . getInstance ( ) . setIdle ( ) ;
399
- if ( this . getAutoClose ( ) && pydio . Controller . react_selector ) {
400
- pydio . UI . modal . dismiss ( ) ;
399
+ if ( this . hasErrors ( ) ) {
400
+ if ( ! pydio . getController ( ) . react_selector ) {
401
+ global . pydio . getController ( ) . fireAction ( "upload" ) ;
402
+ }
403
+ } else if ( this . getAutoClose ( ) ) {
404
+ this . notify ( "auto_close" ) ;
401
405
}
402
406
}
403
407
}
426
430
processed : this . _processed
427
431
} ;
428
432
}
433
+ hasErrors ( ) {
434
+ let result = false ;
435
+ this . _processed . map ( function ( item ) {
436
+ if ( item . getStatus ( ) === 'error' ) {
437
+ result = true ;
438
+ }
439
+ } ) ;
440
+ return result ;
441
+ }
429
442
static getInstance ( ) {
430
443
if ( ! UploaderStore . __INSTANCE ) {
431
444
UploaderStore . __INSTANCE = new UploaderStore ( ) ;
Original file line number Diff line number Diff line change 182
182
this . setState ( { items : store . getItems ( ) } ) ;
183
183
} . bind ( this ) ;
184
184
store . observe ( "update" , this . _storeObserver ) ;
185
+ store . observe ( "auto_close" , function ( ) {
186
+ pydio . UI . modal . dismiss ( ) ;
187
+ } ) ;
185
188
this . setState ( { items : store . getItems ( ) } ) ;
186
189
} ,
187
190
188
191
componentWillUnmount : function ( ) {
189
192
if ( this . _storeObserver ) {
190
193
UploaderModel . Store . getInstance ( ) . stopObserving ( "update" , this . _storeObserver ) ;
194
+ UploaderModel . Store . getInstance ( ) . stopObserving ( "auto_close" ) ;
191
195
}
192
196
} ,
193
197
You can’t perform that action at this time.
0 commit comments