Add option to share CW toggle state across instances of a post

This commit is contained in:
Claire
2022-07-24 20:01:30 +02:00
parent eacde1a130
commit 18346f4044
12 changed files with 191 additions and 69 deletions

View File

@@ -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,