From 841ef606a9b1bc3390830643606b3ec9d65d5120 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 12 Mar 2018 18:39:07 +0100 Subject: Remove text requirement when media attached from statuses (fixes #381) Ports cfa9b6e13ab3c434f3901df6f614d0aa94a3d1ed to glitchsoc --- app/javascript/flavours/glitch/features/composer/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/composer/index.js b/app/javascript/flavours/glitch/features/composer/index.js index e50f3ec3f..792ed79a3 100644 --- a/app/javascript/flavours/glitch/features/composer/index.js +++ b/app/javascript/flavours/glitch/features/composer/index.js @@ -73,6 +73,7 @@ function mapStateToProps (state) { suggestionToken: state.getIn(['compose', 'suggestion_token']), suggestions: state.getIn(['compose', 'suggestions']), text: state.getIn(['compose', 'text']), + anyMedia: state.getIn(['compose', 'media_attachments']).size > 0, }; }; @@ -272,6 +273,7 @@ class Composer extends React.Component { acceptContentTypes, advancedOptions, amUnlocked, + anyMedia, intl, isSubmitting, isUploading, @@ -305,6 +307,8 @@ class Composer extends React.Component { text, } = this.props; + let disabledButton = isSubmitting || isUploading || (!!text.length && !text.trim().length && !anyMedia); + return (