From 61608075e344a4896a425ebe09838290b7ba72d9 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 23 Feb 2024 01:43:21 +0100 Subject: [PATCH] =?UTF-8?q?[WiP]=20Add=20back=20=E2=80=9Cspoilers=20always?= =?UTF-8?q?=20on=E2=80=9D=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glitch/features/compose/components/compose_form.jsx | 3 ++- .../features/compose/containers/compose_form_container.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx index 9428d8366c0f52..ba9e9514933852 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx @@ -49,6 +49,7 @@ class ComposeForm extends ImmutablePureComponent { text: PropTypes.string.isRequired, suggestions: ImmutablePropTypes.list, spoiler: PropTypes.bool, + spoilerAlwaysOn: PropTypes.bool, privacy: PropTypes.string, spoilerText: PropTypes.string, focusDate: PropTypes.instanceOf(Date), @@ -298,7 +299,7 @@ class ComposeForm extends ImmutablePureComponent {
- + {!this.props.spoilerAlwaysOn && } diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index 80b84251b0cff1..0d9df213bd7373 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -15,7 +15,8 @@ import ComposeForm from '../components/compose_form'; const mapStateToProps = state => ({ text: state.getIn(['compose', 'text']), suggestions: state.getIn(['compose', 'suggestions']), - spoiler: state.getIn(['compose', 'spoiler']), + spoiler: state.getIn(['local_settings', 'always_show_spoilers_field']) || state.getIn(['compose', 'spoiler']), + spoilerAlwaysOn: state.getIn(['local_settings', 'always_show_spoilers_field']), spoilerText: state.getIn(['compose', 'spoiler_text']), privacy: state.getIn(['compose', 'privacy']), focusDate: state.getIn(['compose', 'focusDate']),