From e1952ca1462bf2051019357baf2885442c890f6c Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 31 Aug 2018 15:15:05 -0300 Subject: [PATCH] [FIX] Open unsupported videos on browser (#422) --- app/containers/message/Video.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/containers/message/Video.js b/app/containers/message/Video.js index 237f5e38..4476cc0c 100644 --- a/app/containers/message/Video.js +++ b/app/containers/message/Video.js @@ -40,6 +40,12 @@ export default class Video extends React.PureComponent { state = { isVisible: false }; + get uri() { + const { video_url } = this.props.file; + const { baseUrl, user } = this.props; + return `${ baseUrl }${ video_url }?rc_uid=${ user.id }&rc_token=${ user.token }`; + } + toggleModal() { this.setState({ isVisible: !this.state.isVisible @@ -50,14 +56,12 @@ export default class Video extends React.PureComponent { if (isTypeSupported(this.props.file.video_type)) { return this.toggleModal(); } - openLink(this.state.uri); + openLink(this.uri); } render() { const { isVisible } = this.state; - const { video_url, description } = this.props.file; - const { baseUrl, user } = this.props; - const uri = `${ baseUrl }${ video_url }?rc_uid=${ user.id }&rc_token=${ user.token }`; + const { description } = this.props.file; return ( [ this.toggleModal()} > this.toggleModal()} disableVolume />