Skip to content

Commit

Permalink
Merge pull request #33225 from ikevin127/fix/33149
Browse files Browse the repository at this point in the history
Desktop - Chat - Infinite loading displayed on selected chat when navigate to RHP with deeplink
  • Loading branch information
lakchote authored Dec 20, 2023
2 parents d4c3f2f + 3ac5af2 commit 9ea6b39
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 9ea6b39

Please sign in to comment.