From 9378be575b69953329fa67164bfabc37c21357c2 Mon Sep 17 00:00:00 2001 From: fbwoolf Date: Tue, 13 Jun 2023 14:24:07 -0500 Subject: [PATCH] fix: early return if stamps query returns undefined --- src/app/features/collectibles/components/bitcoin/stamps.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/features/collectibles/components/bitcoin/stamps.tsx b/src/app/features/collectibles/components/bitcoin/stamps.tsx index 2433c9b7e80..b3c7c8bd639 100644 --- a/src/app/features/collectibles/components/bitcoin/stamps.tsx +++ b/src/app/features/collectibles/components/bitcoin/stamps.tsx @@ -8,11 +8,11 @@ import { Stamp } from './stamp'; export function Stamps() { const currentAccountBtcAddress = useCurrentAccountNativeSegwitAddressIndexZero(); - const { data: stamps } = useStampsByAddressQuery(currentAccountBtcAddress); + const { data: stamps = [] } = useStampsByAddressQuery(currentAccountBtcAddress); const analytics = useAnalytics(); useEffect(() => { - if (!stamps) return; + if (!stamps.length) return; if (stamps.length > 0) { void analytics.track('view_collectibles', { stamps_count: stamps.length, @@ -21,7 +21,7 @@ export function Stamps() { } }, [analytics, stamps]); - if (!stamps) return null; + if (!stamps.length) return null; return ( <>