From dc12dbe047e270b7df8f459de2c75aebd1f0bb35 Mon Sep 17 00:00:00 2001 From: itschip Date: Sat, 4 Dec 2021 22:04:07 +0100 Subject: [PATCH] fix(phone/marketplace): check our current state of atom, not the value represented --- phone/src/apps/marketplace/hooks/useMarketplaceActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phone/src/apps/marketplace/hooks/useMarketplaceActions.ts b/phone/src/apps/marketplace/hooks/useMarketplaceActions.ts index d4fc4bbf3..57fc78dd8 100644 --- a/phone/src/apps/marketplace/hooks/useMarketplaceActions.ts +++ b/phone/src/apps/marketplace/hooks/useMarketplaceActions.ts @@ -28,9 +28,9 @@ export const useMarketplaceActions = (): MarketplaceActionValues => { const addListing = useRecoilCallback( ({ snapshot }) => (listing: MarketplaceListing) => { - const { contents } = snapshot.getLoadable(listingState); + const { state } = snapshot.getLoadable(listingState); // Make sure our atom is actually loaded before we attempt a dispatch - if (contents !== 'hasValue') return; + if (state !== 'hasValue') return; setListings((curListings) => [listing, ...curListings]); },