From 210e6776fce016666ecfd248b2208c487f3440f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 23 Sep 2017 23:41:25 +0200 Subject: [PATCH] Fix intl warning with disabled secondary toot btn - Moved building the secondary btn text into the if to avoid trying to translate 'none' visibility --- .../compose/components/compose_form.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 56d494dcdf6..5befd03374c 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -170,6 +170,7 @@ export default class ComposeForm extends ImmutablePureComponent { let showSideArm = secondaryVisibility !== 'none'; let publishText = ''; + let publishText2 = ''; const privacyIcons = { none: '', @@ -195,6 +196,13 @@ export default class ComposeForm extends ImmutablePureComponent { } ); + + publishText2 = ( + + ); } else { if (this.props.privacy === 'private' || this.props.privacy === 'direct') { publishText = {intl.formatMessage(messages.publish)}; @@ -203,14 +211,6 @@ export default class ComposeForm extends ImmutablePureComponent { } } - // side-arm - let publishText2 = ( - - ); - const submitDisabled = disabled || this.props.is_uploading || length(text) > 500 || (text.length !== 0 && text.trim().length === 0); return ( @@ -271,8 +271,7 @@ export default class ComposeForm extends ImmutablePureComponent { text={publishText2} onClick={this.handleSubmit2} disabled={submitDisabled} - /> : - '' + /> : '' }