From cccd3b7a58fc69e4969e59c3de0012a1492dbc76 Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Tue, 9 May 2023 10:08:58 +0200 Subject: [PATCH 1/2] fix: fix firefox redirection from old dot --- src/components/DeeplinkWrapper/index.website.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DeeplinkWrapper/index.website.js b/src/components/DeeplinkWrapper/index.website.js index c0f77ae4ead2..ac8e32850860 100644 --- a/src/components/DeeplinkWrapper/index.website.js +++ b/src/components/DeeplinkWrapper/index.website.js @@ -87,7 +87,7 @@ class DeeplinkWrapper extends PureComponent { // This check is necessary for Safari, otherwise, if the user // does NOT have the Expensify desktop app installed, it's gonna // show an error in the page saying that the address is invalid - if (CONST.BROWSER.SAFARI === Browser.getBrowser()) { + if (CONST.BROWSER.SAFARI === Browser.getBrowser() || CONST.BROWSER.FIREFOX === Browser.getBrowser()) { const iframe = document.createElement('iframe'); iframe.style.display = 'none'; document.body.appendChild(iframe); From d9f949209436c77d1cf90d96787788347325ad55 Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Tue, 16 May 2023 09:16:08 +0200 Subject: [PATCH 2/2] fix: apply requested changes --- src/components/DeeplinkWrapper/index.website.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/DeeplinkWrapper/index.website.js b/src/components/DeeplinkWrapper/index.website.js index 5761c73e4c73..856e73b2c794 100644 --- a/src/components/DeeplinkWrapper/index.website.js +++ b/src/components/DeeplinkWrapper/index.website.js @@ -85,10 +85,14 @@ class DeeplinkWrapper extends PureComponent { openRouteInDesktopApp(expensifyDeeplinkUrl) { this.updateAppInstallationCheckStatus(); + const browser = Browser.getBrowser(); + // This check is necessary for Safari, otherwise, if the user // does NOT have the Expensify desktop app installed, it's gonna // show an error in the page saying that the address is invalid - if (CONST.BROWSER.SAFARI === Browser.getBrowser() || CONST.BROWSER.FIREFOX === Browser.getBrowser()) { + // It is also necessary for Firefox, otherwise the window.location.href redirect + // will abort the fetch request from NetInfo, which will cause the app to go offline temporarily. + if (browser === CONST.BROWSER.SAFARI || browser === CONST.BROWSER.FIREFOX) { const iframe = document.createElement('iframe'); iframe.style.display = 'none'; document.body.appendChild(iframe);