fix(discover): follow status change after modal closed
Description
Use useQuery instead of useMutation to set a optimistic update after "add feed" modal closed, while useQuery is more reasonable since "search" is kind of fetching data not update data.
Linked Issues
https://github.com/RSSNext/Follow/issues/254
Additional context
@MaxtuneLee is attempting to deploy a commit to the RSS3 Team on Vercel.
A member of the Team first needs to authorize it.
You should not use useQuery directly in the component; see the defineQuery and onSuccess options in FeedForm.
You should not use
useQuerydirectly in the component; see thedefineQueryandonSuccessoptions inFeedForm.
Thank for the reply, get it
One way to look at it is that you don't need to use useQuery to drive the data update, you can just use useSubscriptionByFeedId hook to get whether the current feed is subscribed or not.
One way to look at it is that you don't need to use
useQueryto drive the data update, you can just useuseSubscriptionByFeedIdhook to get whether the current feed is subscribed or not.
Thanks for the advice, I separated the Card from DiscoverForm into a separate FeedCard component, and use that hook to get latest status ,which seems to be working well now.