fix: Fixes loading web on mobile browser.

Adds missing url prop to DialInSummary and safeguard the URL creation.
This commit is contained in:
Дамян Минков 2022-03-02 08:28:00 -06:00
parent 8bb5c114f8
commit 75d80ad879
2 changed files with 21 additions and 5 deletions

View File

@ -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<Props> {
* @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<Props> {
<DialInSummary
className = 'deep-linking-dial-in'
clickableNumbers = { true }
room = { _room } />
room = { _room }
url = { _url } />
</div>
</div>
);
@ -274,9 +280,12 @@ class DeepLinkingMobilePage extends Component<Props> {
* @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
};
}

View File

@ -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<Props, State> {
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')));
}