From 6cbdf1bb5948bd12e010e7398ccc5b5cbb822024 Mon Sep 17 00:00:00 2001 From: Luc Date: Mon, 2 Sep 2024 11:26:03 +0000 Subject: [PATCH] Patch State --- web/src/App.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index 232ceb2..2c63a9a 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -25,14 +25,13 @@ export const App = () => { } ); - const decodedTransactions = useMemo( - () => - data && - (data?.items.map(decodeTransaction).filter(Boolean) as - | AllMultiReturnTypes[] - | undefined), - [data] - ); + const decodedTransactions = useMemo(() => { + if (!data || !data.items) return; + + return data?.items.map(decodeTransaction).filter(Boolean) as + | AllMultiReturnTypes[] + | undefined; + }, [data]); const totals = useMemo(() => { if (!decodedTransactions) return;