88be3525b5
Fixes #72 Introduces a helper to determine if a contributor is the current user.
17 lines
455 B
JavaScript
17 lines
455 B
JavaScript
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;
|
|
}
|
|
|
|
});
|