From 75d80ad87932743c0437cec488469d9a514f249c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Wed, 2 Mar 2022 08:28:00 -0600 Subject: [PATCH] fix: Fixes loading web on mobile browser. Adds missing url prop to DialInSummary and safeguard the URL creation. --- .../components/DeepLinkingMobilePage.web.js | 15 ++++++++++++--- .../dial-in-summary/web/DialInSummary.js | 11 +++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/react/features/deep-linking/components/DeepLinkingMobilePage.web.js b/react/features/deep-linking/components/DeepLinkingMobilePage.web.js index daac4b67d..ec239d1d0 100644 --- a/react/features/deep-linking/components/DeepLinkingMobilePage.web.js +++ b/react/features/deep-linking/components/DeepLinkingMobilePage.web.js @@ -40,6 +40,11 @@ type Props = { */ _room: string, + /** + * The page current url. + */ + _url: URL, + /** * Used to dispatch actions from the buttons. */ @@ -90,7 +95,7 @@ class DeepLinkingMobilePage extends Component { * @returns {ReactElement} */ render() { - const { _downloadUrl, _room, t } = this.props; + const { _downloadUrl, _room, t, _url } = this.props; const { HIDE_DEEP_LINKING_LOGO, NATIVE_APP_NAME, SHOW_DEEP_LINKING_IMAGE } = interfaceConfig; const downloadButtonClassName = `${_SNS}__button ${_SNS}__button_primary`; @@ -181,7 +186,8 @@ class DeepLinkingMobilePage extends Component { + room = { _room } + url = { _url } /> ); @@ -274,9 +280,12 @@ class DeepLinkingMobilePage extends Component { * @returns {Props} */ function _mapStateToProps(state) { + const { locationURL = {} } = state['features/base/connection']; + return { _downloadUrl: interfaceConfig[`MOBILE_DOWNLOAD_LINK_${Platform.OS.toUpperCase()}`], - _room: decodeURIComponent(state['features/base/conference'].room) + _room: decodeURIComponent(state['features/base/conference'].room), + _url: locationURL }; } diff --git a/react/features/invite/components/dial-in-summary/web/DialInSummary.js b/react/features/invite/components/dial-in-summary/web/DialInSummary.js index ad39cd082..64865af46 100644 --- a/react/features/invite/components/dial-in-summary/web/DialInSummary.js +++ b/react/features/invite/components/dial-in-summary/web/DialInSummary.js @@ -33,7 +33,7 @@ type Props = { /** * The url where we were loaded. */ - url: string, + url: URL | string, /** * Invoked to obtain translated strings. @@ -182,7 +182,14 @@ class DialInSummary extends Component { return Promise.resolve(); } - return getDialInConferenceID(dialInConfCodeUrl, room, mucURL, new URL(this.props.url)) + + let url = this.props.url || {}; + + if (typeof url === 'string' || url instanceof String) { + url = new URL(url); + } + + return getDialInConferenceID(dialInConfCodeUrl, room, mucURL, url) .catch(() => Promise.reject(this.props.t('info.genericError'))); }