Folo icon indicating copy to clipboard operation
Folo copied to clipboard

fix(discover): follow status change after modal closed

Open MaxtuneLee opened this issue 1 year ago • 5 comments

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 avatar Sep 03 '24 15:09 MaxtuneLee

@MaxtuneLee is attempting to deploy a commit to the RSS3 Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 03 '24 15:09 vercel[bot]

You should not use useQuery directly in the component; see the defineQuery and onSuccess options in FeedForm.

hyoban avatar Sep 05 '24 07:09 hyoban

You should not use useQuery directly in the component; see the defineQuery and onSuccess options in FeedForm.

Thank for the reply, get it

MaxtuneLee avatar Sep 05 '24 07:09 MaxtuneLee

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.

Innei avatar Sep 05 '24 08:09 Innei

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.

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.

MaxtuneLee avatar Sep 10 '24 16:09 MaxtuneLee