From d019793fad74580261e414ad4ff5d62ee0625769 Mon Sep 17 00:00:00 2001 From: issyrocks12 Date: Tue, 25 Apr 2017 21:24:21 +0000 Subject: [PATCH] Change to 0 points --- js/forum/dist/extension.js | 7 ++++++- js/forum/src/components/AddAttributes.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/js/forum/dist/extension.js b/js/forum/dist/extension.js index ad69ae6..98ab1ca 100644 --- a/js/forum/dist/extension.js +++ b/js/forum/dist/extension.js @@ -16,10 +16,15 @@ System.register('Reflar/gamification/components/AddAttributes', ['flarum/helpers extend(UserCard.prototype, 'infoItems', function (items, user) { var rank = this.props.user.data.attributes.Rank.split(': '); + var points = this.props.user.data.attributes.Points; + + if (points == 0) { + points = '0'; + } if (rank[0] == '') { rank[0] = app.forum.attribute('DefaultRank'); } - items.add('points', app.translator.trans('reflar-gamification.forum.user.points', { points: this.props.user.data.attributes.Points })); + items.add('points', app.translator.trans('reflar-gamification.forum.user.points', { points: points })); items.add('rank', app.translator.trans('reflar-gamification.forum.user.rank', { rank: rank[0] })); }); diff --git a/js/forum/src/components/AddAttributes.js b/js/forum/src/components/AddAttributes.js index b848479..8304e3b 100644 --- a/js/forum/src/components/AddAttributes.js +++ b/js/forum/src/components/AddAttributes.js @@ -21,11 +21,16 @@ export default function () { extend(UserCard.prototype, 'infoItems', function (items, user) { let rank = this.props.user.data.attributes.Rank.split(': '); + let points = this.props.user.data.attributes.Points; + + if (points == 0) { + points = '0'; + } if (rank[0] == '') { rank[0] = app.forum.attribute('DefaultRank'); } items.add('points', - app.translator.trans('reflar-gamification.forum.user.points', {points: this.props.user.data.attributes.Points}) + app.translator.trans('reflar-gamification.forum.user.points', {points}) ); items.add('rank',