]> cat aescling's git repositories - mastodon.git/commitdiff
Fix wrong sum of usage in hashtag component in web UI (#11755)
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 4 Sep 2019 08:10:18 +0000 (10:10 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Sep 2019 08:10:18 +0000 (10:10 +0200)
1 + 1 = 11

app/javascript/mastodon/components/hashtag.js

index 68b9be72d3e38495408b966d94b1b1f44787040f..62d61326261b3ac5efb1e949ec198a929003a46b 100644 (file)
@@ -12,11 +12,11 @@ const Hashtag = ({ hashtag }) => (
         #<span>{hashtag.get('name')}</span>
       </Permalink>
 
-      <FormattedMessage id='trends.count_by_accounts' defaultMessage='{count} {rawCount, plural, one {person} other {people}} talking' values={{ rawCount: hashtag.getIn(['history', 0, 'accounts']) + hashtag.getIn(['history', 1, 'accounts']), count: <strong>{shortNumberFormat(hashtag.getIn(['history', 0, 'accounts']) + hashtag.getIn(['history', 1, 'accounts']))}</strong> }} />
+      <FormattedMessage id='trends.count_by_accounts' defaultMessage='{count} {rawCount, plural, one {person} other {people}} talking' values={{ rawCount: hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1, count: <strong>{shortNumberFormat(hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1)}</strong> }} />
     </div>
 
     <div className='trends__item__current'>
-      {shortNumberFormat(hashtag.getIn(['history', 0, 'uses']) + hashtag.getIn(['history', 1, 'uses']))}
+      {shortNumberFormat(hashtag.getIn(['history', 0, 'uses']) * 1 + hashtag.getIn(['history', 1, 'uses']) * 1)}
     </div>
 
     <div className='trends__item__sparkline'>