Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(discover): follow status change after modal closed #269

Closed
wants to merge 4 commits into from

Conversation

MaxtuneLee
Copy link

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

#254

Additional context

Copy link

vercel bot commented Sep 3, 2024

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

A member of the Team first needs to authorize it.

@hyoban
Copy link
Member

hyoban commented Sep 5, 2024

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

@MaxtuneLee
Copy link
Author

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

Thank for the reply, get it

@Innei
Copy link
Member

Innei commented Sep 5, 2024

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.

@MaxtuneLee
Copy link
Author

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.

@Innei Innei closed this in 32a55ec Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants