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

pages/index.tsx: Dehydrate query client #1564

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

sashko9807
Copy link
Member

@sashko9807 sashko9807 commented Aug 18, 2023

Needed to update the query state from prefetchQuery on the client. Improves loading time significantly.

-hook/campaigns:Remove staleTime from the useCampaignList.
Showing stale data, might confuse donors, as they expect their donation to be shown immediately.

Needed to update the query state from prefetchQuery on the client. Improves loading time significantly.

-hook/campaigns:Remove staleTime from the useCampaignList.
Showing stale data, might confuse donors, as they expect their donation to be showed immediately.
@github-actions
Copy link

github-actions bot commented Aug 18, 2023

✅ Tests will run for this PR. Once they succeed it can be merged.

@sashko9807 sashko9807 changed the title pages/index.tsx: Dehydrate client pages/index.tsx: Dehydrate query client Aug 18, 2023
@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Aug 21, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Aug 21, 2023
Copy link
Contributor

@igoychev igoychev left a comment

Choose a reason for hiding this comment

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

this is indeed a huge speedup!
the only slight concern I have is that after refreshing the campaigns are reshuffled and their progress bars animations run again and go up or down to the new amounts.

Could you check if we can use a default value of 0 amount when caching so that the animations run smootly always from 0 to the collected amount?

index is not quite good for a key, to track changes of array items
@sashko9807
Copy link
Member Author

sashko9807 commented Aug 21, 2023

this is indeed a huge speedup!
the only slight concern I have is that after refreshing the campaigns are reshuffled and their progress bars animations run again and go up or down to the new amounts.

Could you check if we can use a default value of 0 amount when caching so that the animations run smootly always from 0 to the collected amount?

The issue was caused, due to index being used as key.
Switched to campaign.id. Seems to be fixed now.

Edit:
Looking at prod, there is no animation added to the progress bar. Should I disable it?

@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Aug 22, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Aug 22, 2023
@igoychev igoychev merged commit 2f95736 into podkrepi-bg:master Aug 22, 2023
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.

2 participants