oakstudios / joinmastodon

The official Mastodon project homepage
https://joinmastodon.org
0 stars 0 forks source link

fix server pending bug + clean up #83

Closed mikabusante closed 2 years ago

mikabusante commented 2 years ago

closes #82, I was previously pulling the initial query data from the query cache, but it seems this is not shared between locales. Also trying to clean up the code a bit by moving any data transformations into the select option (reference)

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
joinmastodon ✅ Ready (Inspect) Visit Preview Aug 11, 2022 at 2:19PM (UTC)
mikabusante commented 2 years ago

also very extremely excited to learn that react-query has a keepPreviousData option, which shows the last data in place of a loading state.....was trying to figure this out with useRef as we had before but rlly nice that this is built in https://tanstack.com/query/v4/docs/guides/migrating-to-react-query-3#usepaginatedquery-has-been-deprecated-in-favor-of-the-keeppreviousdata-option

danielgamage commented 2 years ago

this looks great—good finds on caching. do you think we can reuse the language filter while we load new data too? it's causing a layout shift when changing categories

https://user-images.githubusercontent.com/1642599/184177692-bbf09474-3b95-43af-b04a-dcf31746e0b0.mov

mikabusante commented 2 years ago

oo is this on preview rn? thought i fixed this in 8fe3e90 by reworking the apiLanguages.isSuccess check?? (the component always renders but only the options change when the data is updated)

danielgamage commented 2 years ago

you know... i thought it was but i can't repro, so maybe i was looking at another branch's preview. sorry for the false alarm!

mikabusante commented 2 years ago

no worries, ty for looking! :) gonna merge this!!