From 003781bc893c40323fd0d42269ab864d97361475 Mon Sep 17 00:00:00 2001 From: keeandev <38674879+keeandev@users.noreply.github.com> Date: Wed, 14 Jan 2026 20:53:50 -0600 Subject: [PATCH] fix(profile): fix disabled submit button when password fields are filled The button was disabled because selectedLanguoidId could be an empty string, which failed UUID validation. Updated schema to accept empty strings or valid UUIDs, and only include ui_languoid_id in updates when a value is provided. --- views/ProfileView.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/views/ProfileView.tsx b/views/ProfileView.tsx index 257bf6226..6ac375514 100644 --- a/views/ProfileView.tsx +++ b/views/ProfileView.tsx @@ -82,7 +82,13 @@ export default function ProfileView() { const formSchema = z .object({ - selectedLanguoidId: z.uuid(t('selectLanguage')), + selectedLanguoidId: z + .string() + .refine( + (val) => !val || z.uuid().safeParse(val).success, + t('selectLanguage') + ) + .optional(), currentPassword: z.string().trim().optional(), newPassword: z.string().trim().optional(), confirmPassword: z.string().trim().optional(), @@ -142,7 +148,9 @@ export default function ProfileView() { const updatedUser = await profileService.updateProfile({ id: currentUser.id, - ui_languoid_id: data.selectedLanguoidId, + ...(data.selectedLanguoidId + ? { ui_languoid_id: data.selectedLanguoidId } + : {}), ...(isOnline && data.newPassword ? { password: data.newPassword.trim() } : {}),