Skip to content

Commit

Permalink
Add a plugin loading is finished getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Orlando Hohmeier committed Feb 10, 2016
1 parent f58d841 commit 06d6534
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/js/components/Marathon.jsx
Expand Up @@ -58,14 +58,8 @@ var Marathon = React.createClass({
this.onRouteChange();
},

isPluginLoadingComplete: function () {
var pluginLoadingState = PluginStore.pluginsLoadingState;
return pluginLoadingState !== States.STATE_INITIAL &&
pluginLoadingState !== States.STATE_LOADING;
},

onPluginStoreChange: function () {
if (this.isPluginLoadingComplete()) {
if (PluginStore.isPluginsLoadingFinished) {
this.startPolling();
}
},
Expand Down Expand Up @@ -122,7 +116,7 @@ var Marathon = React.createClass({
/* eslint-disable eqeqeq */
if ((prevState.activeAppId != this.state.activeAppId ||
prevState.activeTabId != this.state.activeTabId) &&
this.isPluginLoadingComplete()) {
PluginStore.isPluginsLoadingFinished) {
this.resetPolling();
}
/* eslint-enable eqeqeq */
Expand Down
7 changes: 7 additions & 0 deletions src/js/stores/PluginStore.js
Expand Up @@ -87,6 +87,13 @@ var PluginStore = Util.extendObject({

});
},

get isPluginsLoadingFinished() {

This comment has been minimized.

Copy link
@aldipower

aldipower Feb 10, 2016

Contributor

Thanx for this! Makes me happy.

var pluginLoadingState = this.pluginsLoadingState;
return pluginLoadingState !== States.STATE_INITIAL &&
pluginLoadingState !== States.STATE_LOADING;
},

resetStore: function () {
plugins = [];
}
Expand Down

0 comments on commit 06d6534

Please sign in to comment.