Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jun 30, 2024
1 parent 1ceb2f8 commit a7a4088
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/javascript/flavours/blobfox/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,8 @@ class Status extends ImmutablePureComponent {
extraMedia={extraMedia}
mediaIcons={contentMediaIcons}
expanded={isExpanded}
collapsed={isCollapsed}
collapsed={collapsed}
toggleCollapse={this.handleHotkeyCollapse}
onExpandedToggle={this.handleExpandedToggle}
onTranslate={this.handleTranslate}
parseClick={parseClick}
Expand Down
19 changes: 15 additions & 4 deletions app/javascript/flavours/blobfox/components/status_content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ class StatusContent extends PureComponent {
status: ImmutablePropTypes.map.isRequired,
statusContent: PropTypes.string,
expanded: PropTypes.bool,
collapsed: PropTypes.bool,
onExpandedToggle: PropTypes.func,
onTranslate: PropTypes.func,
media: PropTypes.node,
muted: PropTypes.bool,
extraMedia: PropTypes.node,
mediaIcons: PropTypes.arrayOf(PropTypes.string),
parseClick: PropTypes.func,
Expand All @@ -155,8 +155,18 @@ class StatusContent extends PureComponent {

state = {
hidden: true,
collapsed: false,
};

updateOnProps = [
'settings',
'muted',
];

updateOnStates = [
'collapsed',
];

_updateStatusLinks () {
const node = this.contentsNode;
const { tagLinks, rewriteMentions } = this.props;
Expand Down Expand Up @@ -332,7 +342,6 @@ class StatusContent extends PureComponent {
media,
extraMedia,
mediaIcons,
collapsed,
muted,
settings,
parseClick,
Expand All @@ -343,7 +352,7 @@ class StatusContent extends PureComponent {
statusContent,
} = this.props;

const { isCollapsed } = this.state.collapsed;
const collapsed = this.props.toggleCollapse ? this.props.collapsed : this.state.collapsed;

const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
const contentLocale = intl.locale.replace(/[_-].*/, '');
Expand All @@ -364,8 +373,10 @@ class StatusContent extends PureComponent {

let collapsedHeight = null;

const autoCollapseSettings = settings.getIn(['collapsed', 'auto']);

collapsedHeight = (
settings.getIn(['collapsed', 'auto', 'height'])
parseInt(autoCollapseSettings.get('height'))
)

if (status.get('media_attachments').size && !muted) {
Expand Down

0 comments on commit a7a4088

Please sign in to comment.