Skip to content

Commit

Permalink
fix(phone/marketplace): check our current state of atom, not the valu…
Browse files Browse the repository at this point in the history
…e represented
  • Loading branch information
itschip committed Dec 4, 2021
1 parent 96fbcb9 commit dc12dbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phone/src/apps/marketplace/hooks/useMarketplaceActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
},
Expand Down

0 comments on commit dc12dbe

Please sign in to comment.