]> Eric's Git Repo - listv4.git/commitdiff
Fixing empty list initial content
authorEric Wertz <ericwertz@Erics-MacBook-Pro.local>
Sun, 1 Jun 2025 04:18:11 +0000 (00:18 -0400)
committerEric Wertz <ericwertz@Erics-MacBook-Pro.local>
Sun, 1 Jun 2025 04:18:11 +0000 (00:18 -0400)
frontend/components/ListContext.tsx

index 54b0c55f9b689ee3989d25396f440b4b7d320d2c..79a65eb49f95e9cacf9f4b165aeefca97103763d 100644 (file)
@@ -23,7 +23,7 @@ export const ListContext = () => {
     const fetchItems = async () => {
         try {
             const response = await fetchData('/list/fetch') as { data: ItemProps[] };
-            if (response?.data) {
+            if (response?.data && response.data.length > 0) {
                 // Ensure all items have proper order values
                 const itemsWithOrders = ensureItemOrders(response.data);
                 setItems(itemsWithOrders);