From e70a2211e9c85d49c131fba2dbd7a4db61ad47e7 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sat, 2 Mar 2024 11:07:48 +0000
Subject: ui: Fix sidebar list spinner

---
 packages/web/app/dashboard/components/AllLists.tsx | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

(limited to 'packages/web/app/dashboard/components/AllLists.tsx')

diff --git a/packages/web/app/dashboard/components/AllLists.tsx b/packages/web/app/dashboard/components/AllLists.tsx
index 5b706cbe..78d88654 100644
--- a/packages/web/app/dashboard/components/AllLists.tsx
+++ b/packages/web/app/dashboard/components/AllLists.tsx
@@ -12,6 +12,10 @@ export default function AllLists() {
 
   const { setOpen } = useNewListModal();
 
+  if (!lists) {
+    return <LoadingSpinner />;
+  }
+
   return (
     <ul className="max-h-full gap-y-2 overflow-auto text-sm font-medium">
       <NewListModal />
@@ -21,20 +25,16 @@ export default function AllLists() {
           <Plus />
         </Link>
       </li>
-      {lists && lists.lists.length == 0 && <li>No lists</li>}
-      {lists ? (
-        lists.lists.map((l) => (
-          <SidebarItem
-            key={l.id}
-            logo={<span className="text-lg"> {l.icon}</span>}
-            name={l.name}
-            path={`/dashboard/lists/${l.id}`}
-            className="py-0.5"
-          />
-        ))
-      ) : (
-        <LoadingSpinner />
-      )}
+      {lists.lists.length == 0 && <li>No lists</li>}
+      {lists.lists.map((l) => (
+        <SidebarItem
+          key={l.id}
+          logo={<span className="text-lg"> {l.icon}</span>}
+          name={l.name}
+          path={`/dashboard/lists/${l.id}`}
+          className="py-0.5"
+        />
+      ))}
     </ul>
   );
 }
-- 
cgit v1.2.3-70-g09d2

