Reblog support for collapsed toots

lolsob-rspec
Gô Shoemake 2017-06-23 18:01:29 -07:00 committed by kibigo!
parent 5c3d671a72
commit 26254fc5c4
1 changed files with 6 additions and 4 deletions

View File

@ -20,8 +20,7 @@ const messages = defineMessages({
uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' }, uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' },
}); });
@injectIntl class StatusUnextended extends ImmutablePureComponent {
export default class Status extends ImmutablePureComponent {
static contextTypes = { static contextTypes = {
router: PropTypes.object, router: PropTypes.object,
@ -104,7 +103,7 @@ export default class Status extends ImmutablePureComponent {
this.handleIntersection this.handleIntersection
); );
if (node.clientHeight > 400) this.setState({ isCollapsed: true }); if (node.clientHeight > 400 && !(this.props.status.get('reblog', null) !== null && typeof this.props.status.get('reblog') === 'object')) this.setState({ isCollapsed: true });
this.componentMounted = true; this.componentMounted = true;
} }
@ -260,9 +259,12 @@ export default class Status extends ImmutablePureComponent {
{isCollapsed ? null : media} {isCollapsed ? null : media}
{isCollapsed ? null : <StatusActionBar {...this.props} />} {isCollapsed ? null : <StatusActionBar status={status} account={account} {...other} />}
</div> </div>
); );
} }
} }
const Status = injectIntl(StatusUnextended);
export default Status;