about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account_gallery/index.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-11-27 03:24:11 +0100
committerClaire <claire.github-309c@sitedethib.com>2021-05-07 22:47:09 +0200
commit50b100df00dc03d554acc9f3ca6f5845edcadbd2 (patch)
tree1012485be58ecacf762865f8ea21595daafc4e69 /app/javascript/flavours/glitch/features/account_gallery/index.js
parentd30dd5b1dbbc8e72cd7aefe5ee39684e068b7118 (diff)
Change media modals look in web UI
Port 1e89e2ed988d2103ecd46e06476d863cb40c57c7 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/account_gallery/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/account_gallery/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js
index 81203e3f8..2a43d1ed2 100644
--- a/app/javascript/flavours/glitch/features/account_gallery/index.js
+++ b/app/javascript/flavours/glitch/features/account_gallery/index.js
@@ -114,15 +114,18 @@ class AccountGallery extends ImmutablePureComponent {
   }
 
   handleOpenMedia = attachment => {
+    const { dispatch } = this.props;
+    const statusId = attachment.getIn(['status', 'id']);
+
     if (attachment.get('type') === 'video') {
-      this.props.dispatch(openModal('VIDEO', { media: attachment, status: attachment.get('status'), options: { autoPlay: true } }));
+      dispatch(openModal('VIDEO', { media: attachment, statusId, options: { autoPlay: true } }));
     } else if (attachment.get('type') === 'audio') {
-      this.props.dispatch(openModal('AUDIO', { media: attachment, status: attachment.get('status'), options: { autoPlay: true } }));
+      dispatch(openModal('AUDIO', { media: attachment, statusId, options: { autoPlay: true } }));
     } else {
       const media = attachment.getIn(['status', 'media_attachments']);
       const index = media.findIndex(x => x.get('id') === attachment.get('id'));
 
-      this.props.dispatch(openModal('MEDIA', { media, index, status: attachment.get('status') }));
+      dispatch(openModal('MEDIA', { media, index, statusId }));
     }
   }