Skip to content

Commit

Permalink
Merge pull request #3819 from thematters/fix/loading-state-username
Browse files Browse the repository at this point in the history
fix(username): fix loadign state of `useAvailableUserName`
  • Loading branch information
robertu7 authored Sep 18, 2023
2 parents f988a2f + 7e219c0 commit f08e5d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Dialogs/SetUserNameDialog/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const useAvailableUserName = ({
const presetUserName =
(viewer.info.email as string) || googleId || facebookId || twitterId

const [loading, setLoading] = useState(!!presetUserName)
const [loading, setLoading] = useState(enable && !!presetUserName)
const [index, setIndex] = useState(0)

const [availableUserName, setAvailableUserName] = useState('')
Expand All @@ -46,6 +46,7 @@ export const useAvailableUserName = ({
)

if (!normalizedUserName) {
setLoading(false)
return
}

Expand Down

1 comment on commit f08e5d5

@vercel
Copy link

@vercel vercel bot commented on f08e5d5 Sep 18, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.