Fix highlighting of current user in contributor list

Fixes #72

Introduces a helper to determine if a contributor is the current user.
This commit is contained in:
2019-04-03 01:34:39 +02:00
parent 2954955e39
commit 88be3525b5
4 changed files with 56 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';
import { alias } from '@ember/object/computed';
import { isPresent } from '@ember/utils';
export default Helper.extend({
kredits: service(),
currentUser: alias('kredits.currentUser'),
compute([contributor]) {
return isPresent(contributor) && isPresent(this.currentUser) &&
contributor.account === this.currentUser.account;
}
});