Skip to content
Permalink
Browse files

[DDW-677] Code improvement

  • Loading branch information...
nikolaglumac committed Jun 12, 2019
1 parent ca2d25d commit 70de07a5fbf3660e266bbe6e5276cf21d0c88e1b
Showing with 17 additions and 8 deletions.
  1. +4 −7 source/renderer/app/containers/LoadingPage.js
  2. +13 −1 source/renderer/app/stores/NodeUpdateStore.js
@@ -64,8 +64,9 @@ export default class LoadingPage extends Component<InjectedProps> {
const { version } = environment;
const {
isNewAppVersionAvailable,
isNewAppVersionLoading,
isNewAppVersionLoaded,
availableAppVersion,
getLatestAppVersionRequest,
} = stores.nodeUpdate;

return (
@@ -82,12 +83,8 @@ export default class LoadingPage extends Component<InjectedProps> {
isNodeStopped={isNodeStopped}
isNotEnoughDiskSpace={isNotEnoughDiskSpace}
isNewAppVersionAvailable={isNewAppVersionAvailable}
isNewAppVersionLoading={getLatestAppVersionRequest.isExecuting}
isNewAppVersionLoaded={
getLatestAppVersionRequest.wasExecuted &&
(getLatestAppVersionRequest.result !== null ||
getLatestAppVersionRequest.error)
}
isNewAppVersionLoading={isNewAppVersionLoading}
isNewAppVersionLoaded={isNewAppVersionLoaded}
isSystemTimeCorrect={isSystemTimeCorrect}
isCheckingSystemTime={forceCheckTimeDifferenceRequest.isExecuting}
diskSpaceRequired={diskSpaceRequired}
@@ -1,5 +1,5 @@
// @flow
import { observable, action, runInAction } from 'mobx';
import { action, computed, observable, runInAction } from 'mobx';
import Store from './lib/Store';
import Request from './lib/LocalizedRequest';
import type {
@@ -103,4 +103,16 @@ export default class NodeUpdateStore extends Store {
this.availableAppVersion = latestAppVersion;
};

@computed get isNewAppVersionLoading(): boolean {
return this.getLatestAppVersionRequest.isExecuting;
}

@computed get isNewAppVersionLoaded(): boolean {
return (
this.getLatestAppVersionRequest.wasExecuted &&
(this.getLatestAppVersionRequest.result !== null ||
this.getLatestAppVersionRequest.error)
);
}

}

0 comments on commit 70de07a

Please sign in to comment.
You can’t perform that action at this time.