diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index d291a2d56bf1..cae473b740bc 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -75,6 +75,9 @@ type WorkspacePageWithSectionsProps = WithPolicyAndFullscreenLoadingProps & /** Whether to include safe area padding bottom or not */ includeSafeAreaPaddingBottom?: boolean; + /** Makes firstRender ref display loading page before isLoading is change to true */ + showLoadingAsFirstRender?: boolean; + /** Policy values needed in the component */ policy: OnyxEntry; @@ -118,6 +121,7 @@ function WorkspacePageWithSections({ reimbursementAccount = CONST.REIMBURSEMENT_ACCOUNT.DEFAULT_DATA, route, shouldUseScrollView = false, + showLoadingAsFirstRender = true, shouldSkipVBBACall = true, shouldShowBackButton = false, user, @@ -142,7 +146,7 @@ function WorkspacePageWithSections({ const hasVBA = achState === BankAccount.STATE.OPEN; const content = typeof children === 'function' ? children(hasVBA, policyID, isUsingECard) : children; const {shouldUseNarrowLayout} = useResponsiveLayout(); - const firstRender = useRef(true); + const firstRender = useRef(showLoadingAsFirstRender); const isFocused = useIsFocused(); const prevPolicy = usePrevious(policy); diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsList.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsList.tsx index 54c20bb74e72..8f91397443cd 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsList.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsList.tsx @@ -91,7 +91,6 @@ function WorkspaceCompanyCardsList({policyID, cardsList, selectedFeed}: Workspac renderItem={renderItem} ListHeaderComponent={renderListHeader} stickyHeaderIndices={[0]} - scrollIndicatorInsets={{right: Number.MIN_VALUE}} /> ); diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx index 15bb57f0c267..c86bfd0da83f 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx @@ -75,6 +75,7 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) { guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_COMPANY_CARDS} shouldShowOfflineIndicatorInWideScreen includeSafeAreaPaddingBottom + showLoadingAsFirstRender={false} >