]> cat aescling's git repositories - mastodon.git/commitdiff
Fix open media hotkey (#15308)
authorJeong Arm <kjwonmail@gmail.com>
Tue, 8 Dec 2020 23:24:13 +0000 (08:24 +0900)
committerGitHub <noreply@github.com>
Tue, 8 Dec 2020 23:24:13 +0000 (00:24 +0100)
* Fix open media hotkey

* Update status.js

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
app/javascript/mastodon/components/status.js

index d9e7347f8acf30d7169eae7b0aba81183ac5f86c..295e83f5819607cf5ada9250c30741d2e9fdb9b8 100644 (file)
@@ -203,15 +203,15 @@ class Status extends ImmutablePureComponent {
 
   handleHotkeyOpenMedia = e => {
     const { onOpenMedia, onOpenVideo } = this.props;
-    const statusId = this._properStatus().get('id');
+    const status = this._properStatus();
 
     e.preventDefault();
 
     if (status.get('media_attachments').size > 0) {
       if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
-        onOpenVideo(statusId, status.getIn(['media_attachments', 0]), { startTime: 0 });
+        onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), { startTime: 0 });
       } else {
-        onOpenMedia(statusId, status.get('media_attachments'), 0);
+        onOpenMedia(status.get('id'), status.get('media_attachments'), 0);
       }
     }
   }