Permalink
Browse files

Auto-open / don't auto-close uploader if there were errors during tra…

…nsfer
  • Loading branch information...
1 parent 228560a commit dc0022a87e55fa3cb5cb5b97597f11a2d6d44c7f @cdujeu cdujeu committed Sep 27, 2016
@@ -396,8 +396,12 @@
}.bind(this));
}else{
UploadTask.getInstance().setIdle();
- if(this.getAutoClose() && pydio.Controller.react_selector){
- pydio.UI.modal.dismiss();
+ if(this.hasErrors()){
+ if(!pydio.getController().react_selector){
+ global.pydio.getController().fireAction("upload");
+ }
+ }else if(this.getAutoClose()){
+ this.notify("auto_close");
}
}
}
@@ -426,6 +430,15 @@
processed: this._processed
};
}
+ hasErrors(){
+ let result = false;
+ this._processed.map(function(item){
+ if(item.getStatus() === 'error'){
+ result = true;
+ }
+ });
+ return result;
+ }
static getInstance(){
if(!UploaderStore.__INSTANCE){
UploaderStore.__INSTANCE = new UploaderStore();
@@ -182,12 +182,16 @@
this.setState({items: store.getItems()});
}.bind(this);
store.observe("update", this._storeObserver);
+ store.observe("auto_close", function(){
+ pydio.UI.modal.dismiss();
+ });
this.setState({items: store.getItems()});
},
componentWillUnmount: function(){
if(this._storeObserver){
UploaderModel.Store.getInstance().stopObserving("update", this._storeObserver);
+ UploaderModel.Store.getInstance().stopObserving("auto_close");
}
},

0 comments on commit dc0022a

Please sign in to comment.