Skip to content
Snippets Groups Projects
Unverified Commit 7aee3647 authored by Jeong Arm's avatar Jeong Arm Committed by GitHub
Browse files

Fix open media hotkey (#15308)


* Fix open media hotkey

* Update status.js

Co-authored-by: default avatarEugen Rochko <eugen@zeonfederated.com>
parent 765626a3
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment