From 9d6a1ec2caa76f0d6bf1a352538c788b33eb9b94 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Fri, 19 May 2023 15:57:00 +0800 Subject: [PATCH] Fixed error prompt in dashboard --- src/Routes/Dashboard/Dashboard.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Routes/Dashboard/Dashboard.tsx b/src/Routes/Dashboard/Dashboard.tsx index a9f2117..be81af7 100644 --- a/src/Routes/Dashboard/Dashboard.tsx +++ b/src/Routes/Dashboard/Dashboard.tsx @@ -51,19 +51,21 @@ export default function Dashboard() { ); } - if (logs.error || products.error || lowest_stock_product.isError) { -
- -
- -

Dashboard

+ if (logs.isError || products.isError || lowest_stock_product.isError) { + return ( +
+ +
+ +

Dashboard

+
+
+

+ Error loading dashboard +

+
-
-

- Error loading dashboard -

-
-
; + ); } return (