Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Observer repository_list_refreshed event
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 9, 2016
1 parent 247b54b commit f8be8e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/es6/Pydio.es6
Expand Up @@ -210,7 +210,7 @@ class Pydio extends Observable{
this.observeOnce("registry_part_loaded", function(data){
if(data != "user/repositories") return;
this.Registry.logXmlUser(true);
document.fire("ajaxplorer:repository_list_refreshed", {
this.fire("repository_list_refreshed", {
list:this.user.getRepositoriesList(),
active:this.user.getActiveRepository()});
}.bind(this));
Expand Down
16 changes: 16 additions & 0 deletions core/src/plugins/gui.ajax/res/js/ui/reactjs/jsx/LeftNavigation.js
Expand Up @@ -51,8 +51,24 @@
componentDidMount:function(){
if(this._timer) global.clearTimeout(this._timer);
this._timer = global.setTimeout(this.closeNavigation, 3000);

this._reloadObserver = function(){
if(this.isMounted()){
this.setState({
workspaces:this.props.pydio.user.getRepositoriesList()
});
}
}.bind(this);
this.props.pydio.observe('repository_list_refreshed', this._reloadObserver);
},

componentWillUnmount:function(){
if(this._reloadObserver){
this.props.pydio.stopObserving('repository_list_refreshed', this._reloadObserver);
}
},


openNavigation:function(){
if(!this.state.statusOpen){
this.setState({statusOpen:true});
Expand Down

0 comments on commit f8be8e8

Please sign in to comment.