From 0cbbf29e0448bf931c7ad18ac098010db6b600ae Mon Sep 17 00:00:00 2001 From: Adam Grzybowski Date: Tue, 19 Mar 2024 16:50:45 +0100 Subject: [PATCH] Revert "add shouldSkipDeepLinkNavigation for all platforms" This reverts commit 748898371f1c45e56e6bf29485a94e3f89383f32. --- .../index.desktop.ts} | 0 src/libs/shouldSkipDeepLinkNavigation/index.ts | 5 +++++ src/libs/shouldSkipDeepLinkNavigation/index.web.ts | 12 ++++++++++++ 3 files changed, 17 insertions(+) rename src/libs/{shouldSkipDeepLinkNavigation.ts => shouldSkipDeepLinkNavigation/index.desktop.ts} (100%) create mode 100644 src/libs/shouldSkipDeepLinkNavigation/index.ts create mode 100644 src/libs/shouldSkipDeepLinkNavigation/index.web.ts diff --git a/src/libs/shouldSkipDeepLinkNavigation.ts b/src/libs/shouldSkipDeepLinkNavigation/index.desktop.ts similarity index 100% rename from src/libs/shouldSkipDeepLinkNavigation.ts rename to src/libs/shouldSkipDeepLinkNavigation/index.desktop.ts diff --git a/src/libs/shouldSkipDeepLinkNavigation/index.ts b/src/libs/shouldSkipDeepLinkNavigation/index.ts new file mode 100644 index 000000000000..8a2d8035507f --- /dev/null +++ b/src/libs/shouldSkipDeepLinkNavigation/index.ts @@ -0,0 +1,5 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function shouldSkipDeepLinkNavigation(route: string) { + // no-op for all other platforms + return false; +} diff --git a/src/libs/shouldSkipDeepLinkNavigation/index.web.ts b/src/libs/shouldSkipDeepLinkNavigation/index.web.ts new file mode 100644 index 000000000000..0a2d7f533e74 --- /dev/null +++ b/src/libs/shouldSkipDeepLinkNavigation/index.web.ts @@ -0,0 +1,12 @@ +import ROUTES from '@src/ROUTES'; + +export default function shouldSkipDeepLinkNavigation(route: string) { + // When deep-linking to desktop app with `transition` route we don't want to call navigate + // on the route because it will display an infinite loading indicator. + // See issue: https://github.com/Expensify/App/issues/33149 + if (route.includes(ROUTES.TRANSITION_BETWEEN_APPS)) { + return true; + } + + return false; +}