Siphon880gh / reprint

In alphabetical order, by Aidan Guarniere, Cassandra Hurlbut, Jonathan Wilferd, and Weng Fei Fung. A non-fungible token (NFT) can be a digital file such as pictures, animations, audio, or video but they are not interchangeable because they are made unique by blockchain technology. Because they are unique exclusive items, they can be purchased and passed from one user to another. But what if we just want some samples? With Reprint, users can download and share Reprints of NFTs that are forever free. If you like a style, follow the artist to their actual NFT sales page. Browse trending reprints. Create a collection of your favorite reprints.
4 stars 0 forks source link

Following and unfollowing does not update the profile's Followers list #48

Closed Siphon880gh closed 3 years ago

Siphon880gh commented 3 years ago

See title

Siphon880gh commented 3 years ago

Solved: The profile's Followers list is part of the profile user's state that was queried from graphQL. The querying is done with useQuery.

I exposed the refetch method from useQuery then have useEffect called it whenever the amIAFollower state changed, and the amIAFollower state changed based on the user following or unfollowing by clicking the Follow/Unfollow button.

  let { loading, data: user, refetch } = useQuery(userParam ? GET_USER : GET_ME, {
    variables: { username: userParam },
  });

  useEffect(() => {
    refetch();
  }, [amIAFollower])