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

Wait for preferences before showing suggested feeds #4618

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

haileyok
Copy link
Member

Why

The useSavedFeeds query needs the user's preferences to be loaded first. Generally a user's preferences should be loaded already and cached before we enter the wizard, but its possible for them to be invalidated when we enter. If they are invalidated, they will get refetched inside of useSavedFeeds.

While fetching preferences, the useQuery in useSavedFeeds is disabled. This means that isLoading will be false for a moment - so just checking isLoadingSavedFeeds will not always work. Instead, we want to look at isFetchedAfterMount.

Test Plan

You can add a test promise as shown in the video below and remove staleTime: Infinity.

Before

Screen.Recording.2024-06-24.at.2.16.33.PM.mov

After

Screen.Recording.2024-06-24.at.2.17.24.PM.mov

Copy link

render bot commented Jun 24, 2024

@haileyok haileyok changed the title Hailey/wait for prefs Wait for preferences before showing suggested feeds Jun 24, 2024
Copy link

github-actions bot commented Jun 24, 2024

Old size New size Diff
6.47 MB 6.47 MB 27 B (0.00%)

Copy link
Contributor

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since saved feeds are always earlier in concatenation, is there any downside to making just the concat conditional?

@haileyok
Copy link
Member Author

Yea that seems fine. Probably a good likelihood these will already be loaded so seems nice to have something show up immediately.

@haileyok haileyok merged commit 9e89dde into main Jun 24, 2024
6 checks passed
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.

None yet

2 participants