From 1fd88e3badca480475b77815f6524d2410382b44 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 25 Mar 2017 20:24:30 +0100 Subject: [PATCH] Fix up visual indicators for compose form privacy --- .../features/compose/components/compose_form.jsx | 7 +++---- .../features/compose/containers/compose_form_container.jsx | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/components/features/compose/components/compose_form.jsx b/app/assets/javascripts/components/features/compose/components/compose_form.jsx index 330be566..cd15e8bd 100644 --- a/app/assets/javascripts/components/features/compose/components/compose_form.jsx +++ b/app/assets/javascripts/components/features/compose/components/compose_form.jsx @@ -30,8 +30,7 @@ const ComposeForm = React.createClass({ suggestion_token: React.PropTypes.string, suggestions: ImmutablePropTypes.list, spoiler: React.PropTypes.bool, - private: React.PropTypes.bool, - unlisted: React.PropTypes.bool, + privacy: React.PropTypes.string, spoiler_text: React.PropTypes.string, focusDate: React.PropTypes.instanceOf(Date), preselectDate: React.PropTypes.instanceOf(Date), @@ -137,10 +136,10 @@ const ComposeForm = React.createClass({ ); } - if (this.props.private) { + if (this.props.privacy === 'private' || this.props.privacy === 'direct') { publishText = {intl.formatMessage(messages.publish)}; } else { - publishText = intl.formatMessage(messages.publish) + (!this.props.unlisted ? '!' : ''); + publishText = intl.formatMessage(messages.publish) + (this.props.privacy !== 'unlisted' ? '!' : ''); } return ( diff --git a/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx b/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx index 835b3751..604e1182 100644 --- a/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx +++ b/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx @@ -28,14 +28,13 @@ const mapStateToProps = (state, props) => { suggestions: state.getIn(['compose', 'suggestions']), spoiler: state.getIn(['compose', 'spoiler']), spoiler_text: state.getIn(['compose', 'spoiler_text']), - unlisted: state.getIn(['compose', 'unlisted'], ), - private: state.getIn(['compose', 'private']), + privacy: state.getIn(['compose', 'privacy']), focusDate: state.getIn(['compose', 'focusDate']), preselectDate: state.getIn(['compose', 'preselectDate']), is_submitting: state.getIn(['compose', 'is_submitting']), is_uploading: state.getIn(['compose', 'is_uploading']), me: state.getIn(['compose', 'me']), - needsPrivacyWarning: state.getIn(['compose', 'private']) && mentionedUsernames !== null, + needsPrivacyWarning: (state.getIn(['compose', 'privacy']) === 'private' || state.getIn(['compose', 'privacy']) === 'direct') && mentionedUsernames !== null, mentionedDomains: mentionedUsernamesWithDomains }; };