about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/direct_timeline/components
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-07-24 20:01:30 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-07-25 11:57:09 +0200
commit18346f40443f1c01b45d94be1b0edce20b2c27be (patch)
treeb78b33927842f5dfd374fa5fb9509a809849e358 /app/javascript/flavours/glitch/features/direct_timeline/components
parenteacde1a130a5764686a284d610890ba0f60b193e (diff)
Add option to share CW toggle state across instances of a post
Diffstat (limited to 'app/javascript/flavours/glitch/features/direct_timeline/components')
-rw-r--r--app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js
index 202d96676..7107c9db3 100644
--- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js
+++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js
@@ -132,6 +132,8 @@ class Conversation extends ImmutablePureComponent {
   }
 
   handleShowMore = () => {
+    this.props.onToggleHidden(this.props.lastStatus);
+
     if (this.props.lastStatus.get('spoiler_text')) {
       this.setExpansion(!this.state.isExpanded);
     }
@@ -143,12 +145,13 @@ class Conversation extends ImmutablePureComponent {
 
   render () {
     const { accounts, lastStatus, unread, scrollKey, intl } = this.props;
-    const { isExpanded } = this.state;
 
     if (lastStatus === null) {
       return null;
     }
 
+    const isExpanded = this.props.settings.getIn(['content_warnings', 'shared_state']) ? !lastStatus.get('hidden') : this.state.isExpanded;
+
     const menu = [
       { text: intl.formatMessage(messages.open), action: this.handleClick },
       null,