From 43f5572779f54cee0a73854f0c4fe7bbec35cc2c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 20 Jul 2023 17:08:53 -0300 Subject: [PATCH] empty list when loading --- packages/aml-backoffice-ui/src/pages/Cases.tsx | 6 +++--- packages/demobank-ui/src/hooks/backend.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/aml-backoffice-ui/src/pages/Cases.tsx b/packages/aml-backoffice-ui/src/pages/Cases.tsx index d96e7a90c..8b115ed7e 100644 --- a/packages/aml-backoffice-ui/src/pages/Cases.tsx +++ b/packages/aml-backoffice-ui/src/pages/Cases.tsx @@ -87,7 +87,7 @@ export function Cases() { if (!list.ok && !list.loading) { return handleNotOkResult(i18n)(list); } - + const records = list.loading ? [] : list.data.records return (
@@ -130,7 +130,7 @@ export function Cases() {
- {!list.data.records.length ? ( + {!records.length ? (
empty result
) : (
@@ -159,7 +159,7 @@ export function Cases() { - {list.data.records.map((r) => { + {records.map((r) => { return ( diff --git a/packages/demobank-ui/src/hooks/backend.ts b/packages/demobank-ui/src/hooks/backend.ts index f7c255ead..4b60d1b6c 100644 --- a/packages/demobank-ui/src/hooks/backend.ts +++ b/packages/demobank-ui/src/hooks/backend.ts @@ -158,7 +158,6 @@ interface useBackendType { sandboxCashoutFetcher: (endpoint: string[]) => Promise>; } export function usePublicBackend(): useBackendType { - const { state } = useBackendContext(); const { request: requestHandler } = useApiContext(); const baseUrl = getInitialBackendBaseURL();