-
Notifications
You must be signed in to change notification settings - Fork 582
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
feat(DIA-1062): refetch infinite discovery #11395
feat(DIA-1062): refetch infinite discovery #11395
Conversation
900ef37
to
0959c32
Compare
|
||
return <InfiniteDiscovery artworks={initialData} /> | ||
}, | ||
LoadingFallback: SpinnerFallback, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LoadingFallback
is displayed in two situations: when the component first loads, and when the component refetches its data. However, I want two different things to happen in those situations:
- When the component first loads, I want to show a skeleton loader
- When the component refetches its data, I don't want the component to redraw (because that should happen in the background while the user is viewing the second-to-last artwork.
refetch( | ||
{ excludeArtworkIds: artworks.map((artwork) => artwork.internalID) }, | ||
{ | ||
fetchPolicy: "network-only", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the correct fetch policy because these we are fetching artworks that should not have been "discovered" before.
This PR updates Infinite Discovery to use the
discoverArtwork
query (with refetch) to create an infinite scroll.Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-01-16.at.15.02.11.mp4
Some outstanding issues to be followed-up on:
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.