Skip to content

Commit

Permalink
Desktop - Chat - Infinite loading displayed on selected chat when nav…
Browse files Browse the repository at this point in the history
…igate to RHP with deeplink
  • Loading branch information
ikevin127 committed Dec 20, 2023
1 parent c09a3fe commit 3ac5af2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
});
});
Expand Down
12 changes: 12 additions & 0 deletions src/libs/shouldSkipDeepLinkNavigation/index.desktop.ts
Original file line number Diff line number Diff line change
@@ -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;
}
5 changes: 5 additions & 0 deletions src/libs/shouldSkipDeepLinkNavigation/index.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 3ac5af2

Please sign in to comment.