From 53ff59332bbf2b961846c1b84d8616f151111326 Mon Sep 17 00:00:00 2001 From: Artem Makushov Date: Fri, 22 Nov 2024 10:19:46 +0100 Subject: [PATCH 1/4] update isLoading both for expensify and company cards --- src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx | 2 +- .../workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx index 453be1f58a32..565d10a54324 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx @@ -47,7 +47,7 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) { }, [policyID, workspaceAccountID]); const {isOffline} = useNetwork({onReconnect: fetchCompanyCards}); - const isLoading = !isOffline && (!cardFeeds || cardFeeds.isLoading); + const isLoading = !isOffline && !cardFeeds; useFocusEffect(fetchCompanyCards); diff --git a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx index 0dd050fba4e7..20cb74a6a2b1 100644 --- a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx +++ b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx @@ -36,7 +36,7 @@ function WorkspaceExpensifyCardPage({route}: WorkspaceExpensifyCardPageProps) { useFocusEffect(fetchExpensifyCards); const paymentBankAccountID = cardSettings?.paymentBankAccountID ?? 0; - const isLoading = !isOffline && (!cardSettings || (cardSettings.isLoading && !cardsList)); + const isLoading = !isOffline && !cardSettings; return ( Date: Fri, 22 Nov 2024 14:19:27 +0100 Subject: [PATCH 2/4] revert expensify card loading --- .../workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx index 20cb74a6a2b1..97cadec3ca1a 100644 --- a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx +++ b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx @@ -36,8 +36,7 @@ function WorkspaceExpensifyCardPage({route}: WorkspaceExpensifyCardPageProps) { useFocusEffect(fetchExpensifyCards); const paymentBankAccountID = cardSettings?.paymentBankAccountID ?? 0; - const isLoading = !isOffline && !cardSettings; - + const isLoading = !isOffline && (!cardSettings || (cardSettings.isLoading && !cardsList)); return ( Date: Fri, 22 Nov 2024 14:20:10 +0100 Subject: [PATCH 3/4] get back an empty line --- src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx index 97cadec3ca1a..0dd050fba4e7 100644 --- a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx +++ b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx @@ -37,6 +37,7 @@ function WorkspaceExpensifyCardPage({route}: WorkspaceExpensifyCardPageProps) { const paymentBankAccountID = cardSettings?.paymentBankAccountID ?? 0; const isLoading = !isOffline && (!cardSettings || (cardSettings.isLoading && !cardsList)); + return ( Date: Tue, 26 Nov 2024 00:03:23 +0100 Subject: [PATCH 4/4] update loading --- src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx index 565d10a54324..1b26e4950ef4 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx @@ -47,7 +47,7 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) { }, [policyID, workspaceAccountID]); const {isOffline} = useNetwork({onReconnect: fetchCompanyCards}); - const isLoading = !isOffline && !cardFeeds; + const isLoading = !isOffline && (!cardFeeds || (cardFeeds.isLoading && !cardsList)); useFocusEffect(fetchCompanyCards);