Display the number of checked-in builders #31
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I mostly followed the recipe for reading from a contract in the Scaffold docs. However, when I used the public Arbitrum network I was getting pretty long periods where I would get the default value displayed, and then it would display the spinner, and then display the actual value. I haven't used Wagmi and TanStack too much before, but it appears isLoading only covers when the request is literally inflight - so not the period before when the query is issued and other state is being setup. At least that was my take away from this discussion in the TanStack issues about isLoading vs isPending
And even with isPending it only covers the success case. If I swapped to isPending and handled the rest the same the page would incorrectly show 0 check-ins if there was an error. So instead I used the Wagmi versions and check for isSuccess instead. If there's an error it now just leaves the spinner forever. But I felt that was more accurate than letting it default to 0.
Additional Information
Related Issues
Closes #7
Your ENS/address: mikerowehl.eth (0x9c9234420501c820f73cfA44e822D27e1baAb4D5)