Skip to content

Instantly share code, notes, and snippets.

@Mariusio
Created March 9, 2016 20:09
Show Gist options
  • Save Mariusio/dd1ae1e4d803b7e6781d to your computer and use it in GitHub Desktop.
Save Mariusio/dd1ae1e4d803b7e6781d to your computer and use it in GitHub Desktop.
showDashboardLink: false,
didReceiveAttrs() {
console.log("didReceiveAttrs");
if (this.get('session.isAuthenticated')) {
return this.get('store').findAll('datasource').then((datasources) => {
return this.get('store').filter('datasource', {}, function(datasource) {
return datasource.get('id') != null;
}).then((datasources) => {
console.log("datasources.get('length')");
console.log(datasources.get('length'));
if (datasources.get('length') != 0) {
this.set('showDashboardLink', true);
}
return datasources;
});
});
};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment