[Glitch] Add button to view context to media modal

Port eb63217210 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Eugen Rochko
2019-05-03 16:16:30 +02:00
committed by Thibaut Girka
parent 209c080280
commit bc97fd641f
5 changed files with 90 additions and 8 deletions

View File

@ -112,12 +112,12 @@ export default 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') }));
}
}