From d42f52d3f1af43ba91d129c586ffac47a2024da9 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 25 Dec 2024 09:45:24 +0800 Subject: [PATCH] fix: can not update profile image, close #2267 --- apps/renderer/src/modules/profile/profile-setting-form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/renderer/src/modules/profile/profile-setting-form.tsx b/apps/renderer/src/modules/profile/profile-setting-form.tsx index 24c51ae55a..d2ad59f37f 100644 --- a/apps/renderer/src/modules/profile/profile-setting-form.tsx +++ b/apps/renderer/src/modules/profile/profile-setting-form.tsx @@ -25,7 +25,7 @@ import { CopyButton } from "~/components/ui/code-highlighter" import { toastFetchError } from "~/lib/error-parser" const formSchema = z.object({ - handle: z.string().max(50), + handle: z.string().max(50).optional(), name: z.string().min(3).max(50), image: z.string().url(), }) @@ -43,7 +43,7 @@ export const ProfileSettingForm = ({ const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { - handle: user?.handle || "", + handle: user?.handle || undefined, name: user?.name || "", image: user?.image || "", },