Fixing using given username (#7033)

pull/7041/head
Leo Giovanetti 2023-02-10 10:23:24 -03:00 committed by GitHub
parent 8197ba18d4
commit 53424ca9ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,3 @@
import { useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { IS_SELF_HOSTED } from "@calcom/lib/constants";
@ -6,6 +5,8 @@ import { User } from "@calcom/prisma/client";
import { TRPCClientErrorLike } from "@calcom/trpc/client";
import { AppRouter } from "@calcom/trpc/server/routers/_app";
import useRouterQuery from "@lib/hooks/useRouterQuery";
import { PremiumTextfield } from "./PremiumTextfield";
import { UsernameTextfield } from "./UsernameTextfield";
@ -21,7 +22,7 @@ export const UsernameAvailabilityField = ({
onErrorMutation,
user,
}: UsernameAvailabilityFieldProps) => {
const [currentUsername, setCurrentUsername] = useState(user.username ?? "");
const { username: currentUsername, setQuery: setCurrentUsername } = useRouterQuery("username");
const formMethods = useForm({
defaultValues: {
username: currentUsername,