Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(deep-linking): Don't rely on custom scheme
Hristo Terezov840c0190c453
diff --git a/react/features/deep-linking/components/DeepLinkingDesktopPage.web.js b/react/features/deep-linking/components/DeepLinkingDesktopPage.web.jsindex 5f5191b4a2..22a5de4ecd 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<P : Props> extends Component<P> {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<P : Props> extends Component<P> {* @inheritdoc*/componentDidMount() {- this._openDesktopApp();sendAnalytics(createDeepLinkingPageEvent('displayed', 'DeepLinkingDesktop', { isMobileBrowser: false }));@@ -133,17 +131,6 @@ class DeepLinkingDesktopPage<P : Props> extends Component<P> {);}- _openDesktopApp: () => {}-- /**- * Dispatches the <tt>openDesktopApp</tt> action.- *- * @returns {void}- */- _openDesktopApp() {- this.props.dispatch(openDesktopApp());- }-_onTryAgain: () => {}/**@@ -155,7 +142,7 @@ class DeepLinkingDesktopPage<P : Props> extends Component<P> {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.jsindex 0fe678cd05..f26b9e98ec 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<void>}- */-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<boolean>} - 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.jsnew file mode 100644index 0000000000..3df29ab386--- /dev/null+++ b/react/features/deep-linking/openDesktopApp.js@@ -0,0 +1,9 @@+/**+ * Opens the desktop app.+ *+ * @returns {Promise<boolean>} - 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.jsdeleted file mode 100644index 2f04305e54..0000000000--- a/react/features/deep-linking/shouldShowDeepLinkingDesktopPage.js+++ /dev/null@@ -1,9 +0,0 @@-/**- * Resolves with <tt>true</tt> if the deep linking page should be shown and with- * <tt>false</tt> otherwise.- *- * @returns {Promise<boolean>}- */-export function _shouldShowDeepLinkingDesktopPage() {- return Promise.resolve(false);-}