Skip to content

Commit

Permalink
Merge pull request #51098 from margelo/fix/49964-do-not-show-spinner-…
Browse files Browse the repository at this point in the history
…if-data-is-already-there

fix: do not show spinner if data is already there
  • Loading branch information
stitesExpensify authored Oct 21, 2024
2 parents d808271 + 8f4348a commit f3d918b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
[currentUserAccountID, linkedAction],
);

/**
* Using logical OR operator because with nullish coalescing operator, when `isLoadingApp` is false, the right hand side of the operator
* is not evaluated. This causes issues where we have `isLoading` set to false and later set to true and then set to false again.
* Ideally, `isLoading` should be set initially to true and then set to false. We can achieve this by using logical OR operator.
*/
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const isLoading = isLoadingApp || !reportIDFromRoute || (!isSidebarLoaded && !isInNarrowPaneModal) || PersonalDetailsUtils.isPersonalDetailsEmpty();

const isLoading = isLoadingApp ?? (!reportIDFromRoute || (!isSidebarLoaded && !isInNarrowPaneModal) || PersonalDetailsUtils.isPersonalDetailsEmpty());
const shouldShowSkeleton =
(isLinkingToMessage && !isLinkedMessagePageReady) ||
(!isLinkingToMessage && !isInitialPageReady) ||
Expand Down

0 comments on commit f3d918b

Please sign in to comment.