Skip to content

Commit

Permalink
fix: do not show skeleton if we have data to show
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Oct 18, 2024
1 parent 793dcaf commit 8f4348a
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 8f4348a

Please sign in to comment.