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/632: Hide 'Join now' option when user is logged in #633

Closed
wants to merge 1 commit into from

Conversation

pkmanas22
Copy link
Contributor

PR Fixes:

Resolves #632

Checklist before requesting a review

  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

@pkmanas22
Copy link
Contributor Author

image

npm install error as there is extra comma in last dependencies and I am not fetched the latest commit and created the pull request, that's why the checks failed, please confirm me @hkirat @devsargam whether I have to close this or this is enough

@giripatel
Copy link

giripatel commented May 15, 2024

Hi @pkmanas22

The code you have altered is producing a bug.

Bug: If the user is not loged in, join now and login buttons are not visible to the user.

Screenshot from 2024-05-15 01-57-43

my alternative suggestion:

when the session.data is in undefined state try to render a skeleton insted of hiding the buttons.

if(isLoading){
return (
// skeleton code
)
}

return (
// main component
)

@pkmanas22
Copy link
Contributor Author

pkmanas22 commented May 16, 2024

Thank u @giripatel for notifing about this, but i think using skeleton it does not solve the issue as when user is not logged in, then it should be always undefined, so isLoading is always true. In my case it hides but using skeleton it will always display skeleton not the login and join now button

I found the solution after googling a bit, there is status provided by useSession() hook, in which 3 types authenticated, loading and unauthenticated. Instead of undefined we can use if status is loading or not

@giripatel
Copy link

@pkmanas22 Yes I totally missed out on that

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.

bug: When the page reloads, the "Join now" option is erroneously displayed despite the user being logged in
2 participants