From f564636cb435e6076f50f58fbf16c59c2adaa92c Mon Sep 17 00:00:00 2001
From: llpingll <94099281+llpingll@users.noreply.github.com>
Date: Sun, 25 Jan 2026 19:11:25 +0000
Subject: [PATCH] Fix missingKey warning with helper text
---
.../Account/components/PasswordPanel.jsx | 21 ++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/client/src/Pages/Account/components/PasswordPanel.jsx b/client/src/Pages/Account/components/PasswordPanel.jsx
index 427c263ea..1c365804f 100644
--- a/client/src/Pages/Account/components/PasswordPanel.jsx
+++ b/client/src/Pages/Account/components/PasswordPanel.jsx
@@ -182,7 +182,12 @@ const PasswordPanel = () => {
value={localData.password}
onChange={handleChange}
error={errors[idToName["edit-current-password"]] ? true : false}
- helperText={t(errors[idToName["edit-current-password"]])}
+ helperText={
+ //Only call t() if there is an error to prevent unnecessary localization calls
+ errors[idToName["edit-current-password"]]
+ ? t(errors[idToName["edit-current-password"]])
+ : ""
+ }
endAdornment={}
flex={1}
/>
@@ -208,7 +213,12 @@ const PasswordPanel = () => {
value={localData.newPassword}
onChange={handleChange}
error={errors[idToName["edit-new-password"]] ? true : false}
- helperText={t(errors[idToName["edit-new-password"]])}
+ helperText={
+ //Only call t() if there is an error to prevent unnecessary localization calls
+ errors[idToName["edit-new-password"]]
+ ? t(errors[idToName["edit-new-password"]])
+ : ""
+ }
endAdornment={}
flex={1}
/>
@@ -234,7 +244,12 @@ const PasswordPanel = () => {
value={localData.confirm}
onChange={handleChange}
error={errors[idToName["edit-confirm-password"]] ? true : false}
- helperText={t(errors[idToName["edit-confirm-password"]])}
+ helperText={
+ //Only call t() if there is an error to prevent unnecessary localization calls
+ errors[idToName["edit-confirm-password"]]
+ ? t(errors[idToName["edit-confirm-password"]])
+ : ""
+ }
endAdornment={}
flex={1}
/>