Skip to content

fix: update form methods when username is updated#5403

Merged
emrysal merged 11 commits intomainfrom
fix/username-update
Nov 8, 2022
Merged

fix: update form methods when username is updated#5403
emrysal merged 11 commits intomainfrom
fix/username-update

Conversation

@Udit-takkar
Copy link
Copy Markdown
Contributor

Fixes: #5401

Video:-

Screen.Recording.2022-11-07.at.10.58.51.PM.mov

How to reproduce bug:-
https://threads.com/34432980734?s=ucqt4HpZQcM3tsQmy5m8G5

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 7, 2022

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

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Nov 8, 2022 at 4:34PM (UTC)

@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Nov 7, 2022

  • The useEffect hook is updated to set the form value for username.
  • A new dependency, user?.username, was added to the array of dependencies in useEffect().

@emrysal
Copy link
Copy Markdown
Contributor

emrysal commented Nov 7, 2022

Opened a PR against this branch @ #5405 with a couple of improvements RHF wise.

@Udit-takkar
Copy link
Copy Markdown
Contributor Author

@emrysal there are few issues in the PR after you merged.

  • UserSettings component in /gettting-started page also use UsernameAvailability component and on that component we are using user data from getServerSideProps instead of trpc.useQuery(["viewer.me"]) so currentUsername props does not get updated when you save username.

  • i can't really fix this refCallback type error. if i change type of RefCallback i cannot access .current prop.

@Udit-takkar
Copy link
Copy Markdown
Contributor Author

@emrysal everything working fine now 👍

@emrysal emrysal merged commit 2ba5e6c into main Nov 8, 2022
@emrysal emrysal deleted the fix/username-update branch November 8, 2022 16:36
haffla pushed a commit to tourlane/cal.com that referenced this pull request Nov 22, 2022
* fix: update form methods when username is updated

* Using RHF to decrease state logic in profile.tsx for UsernameAvailability (calcom#5405)

* Type fixes & fixed onboarding

* Removed undefined allowed value + removed invalidation

* No longer need usernameRef.current.value

Co-authored-by: Alex van Andel <me@alexvanandel.com>
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.

[CAL-326] Unable to update username

2 participants