diff --git a/react/features/deep-linking/components/DeepLinkingDesktopPage.web.js b/react/features/deep-linking/components/DeepLinkingDesktopPage.web.js
index 5f5191b4a..22a5de4ec 100644
--- a/react/features/deep-linking/components/DeepLinkingDesktopPage.web.js
+++ b/react/features/deep-linking/components/DeepLinkingDesktopPage.web.js
@@ -50,7 +50,6 @@ class DeepLinkingDesktopPage
extends Component
{
super(props);
// Bind event handlers so they are only bound once per instance.
- this._openDesktopApp = this._openDesktopApp.bind(this);
this._onLaunchWeb = this._onLaunchWeb.bind(this);
this._onTryAgain = this._onTryAgain.bind(this);
}
@@ -61,7 +60,6 @@ class DeepLinkingDesktopPage
extends Component
{
* @inheritdoc
*/
componentDidMount() {
- this._openDesktopApp();
sendAnalytics(
createDeepLinkingPageEvent(
'displayed', 'DeepLinkingDesktop', { isMobileBrowser: false }));
@@ -133,17 +131,6 @@ class DeepLinkingDesktopPage
extends Component
{
);
}
- _openDesktopApp: () => {}
-
- /**
- * Dispatches the openDesktopApp action.
- *
- * @returns {void}
- */
- _openDesktopApp() {
- this.props.dispatch(openDesktopApp());
- }
-
_onTryAgain: () => {}
/**
@@ -155,7 +142,7 @@ class DeepLinkingDesktopPage
extends Component
{
sendAnalytics(
createDeepLinkingPageEvent(
'clicked', 'tryAgainButton', { isMobileBrowser: false }));
- this._openDesktopApp();
+ this.props.dispatch(openDesktopApp());
}
_onLaunchWeb: () => {}
diff --git a/react/features/deep-linking/functions.js b/react/features/deep-linking/functions.js
index 0fe678cd0..f26b9e98e 100644
--- a/react/features/deep-linking/functions.js
+++ b/react/features/deep-linking/functions.js
@@ -8,28 +8,7 @@ import {
DeepLinkingMobilePage,
NoMobileApp
} from './components';
-import { _shouldShowDeepLinkingDesktopPage }
- from './shouldShowDeepLinkingDesktopPage';
-
-/**
- * Promise that resolves when the window load event is received.
- *
- * @type {Promise}
- */
-const windowLoadedPromise = new Promise(resolve => {
- /**
- * Handler for the window load event.
- *
- * @returns {void}
- */
- function onWindowLoad() {
- resolve();
- window.removeEventListener('load', onWindowLoad);
- }
-
- window.addEventListener('load', onWindowLoad);
-});
-
+import { _openDesktopApp } from './openDesktopApp';
/**
* Generates a deep linking URL based on the current window URL.
@@ -96,23 +75,17 @@ export function getDeepLinkingPage(state) {
return Promise.resolve();
}
- return _shouldShowDeepLinkingDesktopPage().then(
+ return _openDesktopApp().then(
// eslint-disable-next-line no-confusing-arrow
- show => show ? DeepLinkingDesktopPage : undefined);
+ result => result ? DeepLinkingDesktopPage : undefined);
}
/**
* Opens the desktop app.
*
- * @returns {void}
+ * @returns {Promise} - Resolves with true if the attempt to open the desktop app was successful and resolves
+ * with false otherwise.
*/
export function openDesktopApp() {
- windowLoadedPromise.then(() => {
- // If the code for opening the deep link is executed before the window
- // load event, something with the internal chrome state goes wrong. The
- // result is that no window load event is received which is the cause
- // for some permission prompts to not be displayed. In our case the GUM
- // prompt wasn't displayed which causes the GUM call to never finish.
- window.location.href = generateDeepLinkingURL();
- });
+ return _openDesktopApp();
}
diff --git a/react/features/deep-linking/openDesktopApp.js b/react/features/deep-linking/openDesktopApp.js
new file mode 100644
index 000000000..3df29ab38
--- /dev/null
+++ b/react/features/deep-linking/openDesktopApp.js
@@ -0,0 +1,9 @@
+/**
+ * Opens the desktop app.
+ *
+ * @returns {Promise} - Resolves with true if the attempt to open the desktop app was successful and resolves
+ * with false otherwise.
+ */
+export function _openDesktopApp() {
+ return Promise.resolve(false);
+}
diff --git a/react/features/deep-linking/shouldShowDeepLinkingDesktopPage.js b/react/features/deep-linking/shouldShowDeepLinkingDesktopPage.js
deleted file mode 100644
index 2f04305e5..000000000
--- a/react/features/deep-linking/shouldShowDeepLinkingDesktopPage.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Resolves with true if the deep linking page should be shown and with
- * false otherwise.
- *
- * @returns {Promise}
- */
-export function _shouldShowDeepLinkingDesktopPage() {
- return Promise.resolve(false);
-}