Skip to content

Instantly share code, notes, and snippets.

@Mariusio
Created March 9, 2016 18:51
Show Gist options
  • Save Mariusio/b4e37b223c854b31f33b to your computer and use it in GitHub Desktop.
Save Mariusio/b4e37b223c854b31f33b to your computer and use it in GitHub Desktop.
showDashboardLink: Ember.computed(
function() {
if (this.get('session.isAuthenticated')) {
return this.get('store').findAll('datasource').then((datasources) => {
this.get('store').filter('datasource', {}, function(datasource) {
return datasource.get('id') != null;
}).then((datasources) => {
if (datasources.get('length') != 0) {
return true
} else {
return false
}
});
});
} else {
return false
}
}
),
@locks
Copy link

locks commented Mar 9, 2016

(datasources) => {
              this.set('showDashboardLink', true);
            }.bind(this)

unnecesary bind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment