Add button to view context to media modal (#10676)

* Add "view context" button to media modal when opened from gallery

* Add "view context" button to video modal

Allow closing the video modal by navigating back in the browser,
just like the media modal
This commit is contained in:
Eugen Rochko
2019-05-03 16:16:30 +02:00
committed by GitHub
parent ecbea2e3c6
commit eb63217210
5 changed files with 119 additions and 12 deletions

View File

@ -100,12 +100,12 @@ class AccountGallery extends ImmutablePureComponent {
handleOpenMedia = attachment => {
if (attachment.get('type') === 'video') {
this.props.dispatch(openModal('VIDEO', { media: attachment }));
this.props.dispatch(openModal('VIDEO', { media: attachment, status: attachment.get('status') }));
} 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 }));
this.props.dispatch(openModal('MEDIA', { media, index, status: attachment.get('status') }));
}
}