From 3187844b504df68e301cb47a910e08d17b9d9b60 Mon Sep 17 00:00:00 2001 From: Dejan Date: Sun, 27 Oct 2024 17:38:09 +0100 Subject: [PATCH] - Fixed issue with undefined value for the grocery requested by section --- components/pages/grocery/GroceryItem.tsx | 2 +- components/pages/grocery/GroceryList.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/pages/grocery/GroceryItem.tsx b/components/pages/grocery/GroceryItem.tsx index 72f19cd..ac6202e 100644 --- a/components/pages/grocery/GroceryItem.tsx +++ b/components/pages/grocery/GroceryItem.tsx @@ -183,7 +183,7 @@ const GroceryItem = ({ fontWeight: "bold", }} > - {getInitials(itemCreator.firstName, itemCreator.lastName ?? "")} + {itemCreator ? getInitials(itemCreator.firstName, itemCreator.lastName) : ""} } diff --git a/components/pages/grocery/GroceryList.tsx b/components/pages/grocery/GroceryList.tsx index e66305b..ce4e882 100644 --- a/components/pages/grocery/GroceryList.tsx +++ b/components/pages/grocery/GroceryList.tsx @@ -1,6 +1,6 @@ import { FlatList, StyleSheet } from "react-native"; import React, { useEffect, useState } from "react"; -import { Button, Text, TouchableOpacity, View } from "react-native-ui-lib"; +import { Text, TouchableOpacity, View } from "react-native-ui-lib"; import GroceryItem from "./GroceryItem"; import { GroceryCategory,