From cf642b0b8f115d3b5551a8fa6c3794c1d2681e5a Mon Sep 17 00:00:00 2001 From: noellabo Date: Fri, 30 Jul 2021 15:32:05 +0900 Subject: [PATCH] Fix CircleDropdown --- .../containers/circle_dropdown_container.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/javascript/mastodon/features/compose/containers/circle_dropdown_container.js b/app/javascript/mastodon/features/compose/containers/circle_dropdown_container.js index 958a903e2..9e2fb8645 100644 --- a/app/javascript/mastodon/features/compose/containers/circle_dropdown_container.js +++ b/app/javascript/mastodon/features/compose/containers/circle_dropdown_container.js @@ -2,16 +2,11 @@ import { connect } from 'react-redux'; import CircleDropdown from '../components/circle_dropdown'; import { changeComposeCircle } from '../../../actions/compose'; -const mapStateToProps = state => { - let value = state.getIn(['compose', 'circle_id']); - value = value === null ? '' : value; - - return { - value: value, - visible: state.getIn(['compose', 'privacy']) === 'limited', - limitedReply: state.getIn(['compose', 'privacy']) === 'limited' && state.getIn(['compose', 'reply_status', 'visibility']) === 'limited', - }; -}; +const mapStateToProps = state => ({ + value: state.getIn(['compose', 'circle_id']) ?? '', + visible: state.getIn(['compose', 'privacy']) === 'limited', + limitedReply: state.getIn(['compose', 'privacy']) === 'limited' && state.getIn(['compose', 'reply_status', 'visibility']) === 'limited', +}); const mapDispatchToProps = dispatch => ({