Update controller.js

Code refactor
This commit is contained in:
Shovan Maity 2018-01-02 09:41:38 -08:00 committed by GitHub
parent 524069b154
commit 3663f446e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -14,12 +14,13 @@ export default Controller.extend({
refreshTimer: null, refreshTimer: null,
init() { init() {
this._super(...arguments); this._super(...arguments);
let cluster = this.get('cluster'); let cluster = this.get('cluster');
if(cluster.state!=="inactive"){ if(cluster.state==="inactive"){
this.send('cancel'); this.scheduleRefresh();
} }else{
this.scheduleRefresh(); this.scheduleRefresh();
}
}, },
willDestroyElement() { willDestroyElement() {