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

fix: Flickering username #1248

Merged
merged 1 commit into from
Nov 6, 2023
Merged

fix: Flickering username #1248

merged 1 commit into from
Nov 6, 2023

Conversation

bprusinowski
Copy link
Collaborator

This PR removes providers presence checking each time we want to get current user, as there doesn't seem a reason to do so at this point, and this causes the username to switch back between currently logged in username and "Sign in" string when navigating through the pages.

Copy link

vercel bot commented Nov 3, 2023

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

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 2:09pm

Copy link
Collaborator

@lloydrichards lloydrichards left a comment

Choose a reason for hiding this comment

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

Makes sense. Looks like each time useUser() is called, the useProviders() is initialised with the default "loading" state causing it to return null. Maybe its better to keep the useProviders() and just remove its nesting from useUser incase you need it later within a component 🤷‍♂️

@bprusinowski bprusinowski merged commit e65ac3c into main Nov 6, 2023
3 of 4 checks passed
@bprusinowski bprusinowski deleted the fix/flickering-username branch November 6, 2023 08:02
@bprusinowski
Copy link
Collaborator Author

bprusinowski commented Nov 8, 2023

It might be worth keeping, but I think I don't really see the point of this hook – it looks like it returns a list of providers configured for login, but in our case it'll always be just one (Keycloak). Also, it might be easier to just check for the presence of the env variables used to create the provider, instead of calling an async hook 👀

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