diff --git a/app/javascript/mastodon/features/compose/components/character_counter.js b/app/javascript/mastodon/features/compose/components/character_counter.js index 0ecfc9141..9ffae9949 100644 --- a/app/javascript/mastodon/features/compose/components/character_counter.js +++ b/app/javascript/mastodon/features/compose/components/character_counter.js @@ -6,20 +6,22 @@ export default class CharacterCounter extends React.PureComponent { static propTypes = { text: PropTypes.string.isRequired, - max: PropTypes.number.isRequired, + max : PropTypes.number.isRequired, }; - checkRemainingText (diff) { + checkRemainingText(textlength, max) { + const diff = this.props.max - textlength; if (diff < 0) { - return {diff}; + return {diff}; } - return {diff}; + return {textlength} / {max}; } - render () { - const diff = this.props.max - length(this.props.text); - return this.checkRemainingText(diff); + render() { + + const leng = length(this.props.text); + return this.checkRemainingText(leng, this.props.max); } }