From 15af6c619de70336bcdfbabbd32b9d93aabefc5b Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 22 Sep 2023 18:34:49 -0300
Subject: towards new core bank api

---
 packages/demobank-ui/src/pages/HomePage.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'packages/demobank-ui/src/pages/HomePage.tsx')

diff --git a/packages/demobank-ui/src/pages/HomePage.tsx b/packages/demobank-ui/src/pages/HomePage.tsx
index 8d5e1f3b9..d80a57d21 100644
--- a/packages/demobank-ui/src/pages/HomePage.tsx
+++ b/packages/demobank-ui/src/pages/HomePage.tsx
@@ -120,8 +120,8 @@ export function handleNotOkResult(
 ) => VNode {
   return function handleNotOkResult2<T>(
     result:
-      | HttpResponsePaginated<T, SandboxBackend.SandboxError>
-      | HttpResponse<T, SandboxBackend.SandboxError>,
+      | HttpResponsePaginated<T, SandboxBackend.SandboxError | undefined>
+      | HttpResponse<T, SandboxBackend.SandboxError| undefined>,
   ): VNode {
     if (result.loading) return <Loading />;
     if (!result.ok) {
@@ -139,7 +139,7 @@ export function handleNotOkResult(
           notify({
             type: "error",
             title: i18n.str`Could not load due to a client error`,
-            description: errorData.error.description as TranslatedString,
+            description: errorData?.error?.description as TranslatedString,
             debug: JSON.stringify(result),
           });
           break;
@@ -148,7 +148,7 @@ export function handleNotOkResult(
           notify({
             type: "error",
             title: i18n.str`Server returned with error`,
-            description: result.payload.error.description as TranslatedString,
+            description: result.payload?.error?.description as TranslatedString,
             debug: JSON.stringify(result.payload),
           });
           break;
-- 
cgit v1.2.3

