From 3ac5af2730ea9b4392919e505704c22a3468d97d Mon Sep 17 00:00:00 2001 From: Kevin Brian Bader Date: Wed, 20 Dec 2023 12:34:30 +0200 Subject: [PATCH] Desktop - Chat - Infinite loading displayed on selected chat when navigate to RHP with deeplink --- src/libs/actions/Report.ts | 5 +++++ .../shouldSkipDeepLinkNavigation/index.desktop.ts | 12 ++++++++++++ src/libs/shouldSkipDeepLinkNavigation/index.ts | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 src/libs/shouldSkipDeepLinkNavigation/index.desktop.ts create mode 100644 src/libs/shouldSkipDeepLinkNavigation/index.ts diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 135e616f7691..0ea325cacf00 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -24,6 +24,7 @@ import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as Pusher from '@libs/Pusher/pusher'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import shouldSkipDeepLinkNavigation from '@libs/shouldSkipDeepLinkNavigation'; import * as UserUtils from '@libs/UserUtils'; import Visibility from '@libs/Visibility'; import CONFIG from '@src/CONFIG'; @@ -2032,6 +2033,10 @@ function openReportFromDeepLink(url: string, isAuthenticated: boolean) { return; } + if (shouldSkipDeepLinkNavigation(route)) { + return; + } + Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH); }); }); diff --git a/src/libs/shouldSkipDeepLinkNavigation/index.desktop.ts b/src/libs/shouldSkipDeepLinkNavigation/index.desktop.ts new file mode 100644 index 000000000000..0a2d7f533e74 --- /dev/null +++ b/src/libs/shouldSkipDeepLinkNavigation/index.desktop.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; +} 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; +}