mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-23 21:56:47 +00:00
Fix open media hotkey (#15308)
* Fix open media hotkey * Update status.js Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
parent
765626a3a7
commit
7aee364795
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue