Fix clicking on the “TOOT” button send bogus visibility parameter

pull/1288/head
Thibaut Girka 2020-02-15 23:51:24 +01:00 committed by ThibG
parent 40798cba41
commit 955f838f9d
1 changed files with 6 additions and 2 deletions

View File

@ -38,8 +38,12 @@ class Publisher extends ImmutablePureComponent {
sideArm: PropTypes.oneOf(['none', 'direct', 'private', 'unlisted', 'public']),
};
handleSubmit = () => {
this.props.onSubmit();
};
render () {
const { countText, disabled, intl, onSecondarySubmit, onSubmit, privacy, sideArm } = this.props;
const { countText, disabled, intl, onSecondarySubmit, privacy, sideArm } = this.props;
const diff = maxChars - length(countText || '');
const computedClass = classNames('composer--publisher', {
@ -105,7 +109,7 @@ class Publisher extends ImmutablePureComponent {
}
}()}
title={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${privacy}.short` })}`}
onClick={onSubmit}
onClick={this.handleSubmit}
disabled={disabled || diff < 0}
/>
</div>