From 12df28f7fdb00b0d2eeb2594b35a996860a20c9f Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 10 May 2020 10:43:02 +0200 Subject: [PATCH] Fix ESLint errors --- .eslintrc.js | 6 ++++-- app/components/user-avatar/component.js | 3 +++ app/helpers/contribution-status.js | 4 +--- app/services/kredits.js | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5e87acb..cc287d7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,8 +25,10 @@ module.exports = { }, rules: { 'ember/avoid-leaking-state-in-ember-objects': 'warn', - 'no-console': 'off' - 'ember/no-jquery': 'error' + 'no-console': 'off', + 'ember/no-jquery': 'error', + 'ember/require-computed-property-dependencies': 'warn', + 'ember/no-observers': 'off' }, overrides: [ // node files diff --git a/app/components/user-avatar/component.js b/app/components/user-avatar/component.js index e37ab88..46e81f2 100644 --- a/app/components/user-avatar/component.js +++ b/app/components/user-avatar/component.js @@ -24,6 +24,9 @@ export default Component.extend({ if (github_uid) { return `https://avatars2.githubusercontent.com/u/${github_uid}?v=3&s=${SIZES[this.size]}`; + } else { + // TODO use custom avatar + return ''; } }) diff --git a/app/helpers/contribution-status.js b/app/helpers/contribution-status.js index cab5832..b9d9fd8 100644 --- a/app/helpers/contribution-status.js +++ b/app/helpers/contribution-status.js @@ -50,9 +50,7 @@ export default Helper.extend({ }, triggerRecompute () { - once(this, function () { - this.recompute(); - }); + once(this, this.recompute); } }); diff --git a/app/services/kredits.js b/app/services/kredits.js index 2c6773c..bd1b0f5 100644 --- a/app/services/kredits.js +++ b/app/services/kredits.js @@ -251,12 +251,12 @@ export default Service.extend({ }); }, - getCurrentUser: computed('kredits.provider', function() { + getCurrentUser: computed('kredits.provider', 'currentUserAccounts.[]', function() { if (isEmpty(this.currentUserAccounts)) { return RSVP.resolve(); } return this.kredits.Contributor - .functions.getContributorIdByAddress(this.get('currentUserAccounts.firstObject')) + .functions.getContributorIdByAddress(this.currentUserAccounts.firstObject) .then((id) => { // check if the user is a contributor or not if (id === 0) {