diff --git a/app/soapbox/features/ui/components/profile_media_panel.js b/app/soapbox/features/ui/components/profile_media_panel.js index 7d01a2f5a..200813156 100644 --- a/app/soapbox/features/ui/components/profile_media_panel.js +++ b/app/soapbox/features/ui/components/profile_media_panel.js @@ -35,13 +35,19 @@ class ProfileMediaPanel extends ImmutablePureComponent { this.props.dispatch(expandAccountMediaTimeline(accountId)); } + componentDidUpdate() { + const { account } = this.props; + const accountId = account.get('id'); + this.props.dispatch(expandAccountMediaTimeline(accountId)); + } + render() { - const { attachments } = this.props; + const { attachments, account } = this.props; const nineAttachments = attachments.slice(0, 9); - - if (attachments.isEmpty()) { - return null; - } + // + // if (attachments.isEmpty()) { + // return null; + // } return (
@@ -51,18 +57,20 @@ class ProfileMediaPanel extends ImmutablePureComponent {
-
-
- {nineAttachments.map((attachment, index) => ( - - ))} + {account && +
+
+ {!nineAttachments.isEmpty() && nineAttachments.map((attachment, index) => ( + + ))} +
-
+ }
); };