-
Notifications
You must be signed in to change notification settings - Fork 132
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
chore: add loading state to the response of useUser (initial PR, still polishing and testing) #1199
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “graphite-merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
@@ -35,6 +39,13 @@ export const useUser = (): UseUserResult => { | |||
const eoaUser = useMemo(() => { | |||
if (account.status !== "connected" && account.status !== "reconnecting") { | |||
return null; | |||
} else if (account.status == "reconnecting") { |
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.
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.
thanks @moldy530 . I am brand new to ts.
change is on its way.
It's always super helpful to include how you tested it in your PR! Feel free to add a video or screenshot that helps illistrate how the fix was made and how you ensure there weren't any regressions. If you aren't sure what or how to test the UI please ping myself, @dphilipson, @moldy530!! |
Pull Request Checklist
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)PR-Codex overview
This PR enhances the
useUser
hook's type definitions and logic to include a loading state for users while the account is reconnecting. It improves type safety and clarity regarding the user status.Detailed summary
UseUserResult
type to include a loading state.useUser
hook.loading
property is optional for certain user types.