|
|
@ -73,6 +73,7 @@ function mapStateToProps (state) { |
|
|
|
suggestionToken: state.getIn(['compose', 'suggestion_token']), |
|
|
|
suggestionToken: state.getIn(['compose', 'suggestion_token']), |
|
|
|
suggestions: state.getIn(['compose', 'suggestions']), |
|
|
|
suggestions: state.getIn(['compose', 'suggestions']), |
|
|
|
text: state.getIn(['compose', 'text']), |
|
|
|
text: state.getIn(['compose', 'text']), |
|
|
|
|
|
|
|
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -272,6 +273,7 @@ class Composer extends React.Component { |
|
|
|
acceptContentTypes, |
|
|
|
acceptContentTypes, |
|
|
|
advancedOptions, |
|
|
|
advancedOptions, |
|
|
|
amUnlocked, |
|
|
|
amUnlocked, |
|
|
|
|
|
|
|
anyMedia, |
|
|
|
intl, |
|
|
|
intl, |
|
|
|
isSubmitting, |
|
|
|
isSubmitting, |
|
|
|
isUploading, |
|
|
|
isUploading, |
|
|
@ -305,6 +307,8 @@ class Composer extends React.Component { |
|
|
|
text, |
|
|
|
text, |
|
|
|
} = this.props; |
|
|
|
} = this.props; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let disabledButton = isSubmitting || isUploading || (!!text.length && !text.trim().length && !anyMedia); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className='composer'> |
|
|
|
<div className='composer'> |
|
|
|
<ComposerSpoiler |
|
|
|
<ComposerSpoiler |
|
|
@ -374,7 +378,7 @@ class Composer extends React.Component { |
|
|
|
/> |
|
|
|
/> |
|
|
|
<ComposerPublisher |
|
|
|
<ComposerPublisher |
|
|
|
countText={`${spoilerText}${countableText(text)}${advancedOptions && advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`} |
|
|
|
countText={`${spoilerText}${countableText(text)}${advancedOptions && advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`} |
|
|
|
disabled={isSubmitting || isUploading || !!text.length && !text.trim().length} |
|
|
|
disabled={disabledButton} |
|
|
|
intl={intl} |
|
|
|
intl={intl} |
|
|
|
onSecondarySubmit={handleSecondarySubmit} |
|
|
|
onSecondarySubmit={handleSecondarySubmit} |
|
|
|
onSubmit={handleSubmit} |
|
|
|
onSubmit={handleSubmit} |
|
|
@ -436,6 +440,7 @@ Composer.propTypes = { |
|
|
|
onUndoUpload: PropTypes.func, |
|
|
|
onUndoUpload: PropTypes.func, |
|
|
|
onUnmount: PropTypes.func, |
|
|
|
onUnmount: PropTypes.func, |
|
|
|
onUpload: PropTypes.func, |
|
|
|
onUpload: PropTypes.func, |
|
|
|
|
|
|
|
anyMedia: PropTypes.bool, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Connecting and export.
|
|
|
|
// Connecting and export.
|
|
|
|