Don't fetch /jobs when not in pro
We pass runningJobsCount to repos-list-tabs component, which essentially is a binding and a binding will call the property that we're passing, which in turn will fetch running and queued jobs. In order to avoid this, I added guards in computed properties.
This commit is contained in:
parent
20b72e5f10
commit
57dec8f2fc
|
@ -103,6 +103,7 @@ var Controller = Ember.Controller.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
runningJobs: function() {
|
runningJobs: function() {
|
||||||
|
if(!this.get('config.pro')) { return [] };
|
||||||
var result;
|
var result;
|
||||||
|
|
||||||
result = this.store.filter('job', {}, function(job) {
|
result = this.store.filter('job', {}, function(job) {
|
||||||
|
@ -114,9 +115,11 @@ var Controller = Ember.Controller.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}.property(),
|
}.property('config.pro'),
|
||||||
|
|
||||||
queuedJobs: function() {
|
queuedJobs: function() {
|
||||||
|
if(!this.get('config.pro')) { return [] };
|
||||||
|
|
||||||
var result;
|
var result;
|
||||||
result = this.get('store').filter('job', function(job) {
|
result = this.get('store').filter('job', function(job) {
|
||||||
return ['created'].indexOf(job.get('state')) !== -1;
|
return ['created'].indexOf(job.get('state')) !== -1;
|
||||||
|
@ -127,7 +130,7 @@ var Controller = Ember.Controller.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}.property(),
|
}.property('config.pro'),
|
||||||
|
|
||||||
recentRepos: function() {
|
recentRepos: function() {
|
||||||
return [];
|
return [];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user