Compare commits
No commits in common. "59ddb35bb2715ea6af5859d8b2d29205b66dd39c" and "130f635017c8ca0364ace5b49601caa4be9849ec" have entirely different histories.
59ddb35bb2
...
130f635017
|
|
@ -42,9 +42,6 @@ export default function ChangePasswordScreen() {
|
|||
if (!newPassword) {
|
||||
setNewError("New password is required");
|
||||
hasError = true;
|
||||
} else if (currentPassword && newPassword === currentPassword) {
|
||||
setNewError("New password cannot be the same as current password");
|
||||
hasError = true;
|
||||
} else if (newPassword.length < 8) {
|
||||
setNewError("New password must be at least 8 characters");
|
||||
hasError = true;
|
||||
|
|
@ -92,14 +89,7 @@ export default function ChangePasswordScreen() {
|
|||
const errMsg =
|
||||
err?.response?.data?.detail ||
|
||||
"Failed to update password. Please check your current password.";
|
||||
if (
|
||||
typeof errMsg === "string" &&
|
||||
errMsg.toLowerCase().includes("same")
|
||||
) {
|
||||
setNewError(errMsg);
|
||||
} else {
|
||||
setCurrentError(errMsg);
|
||||
}
|
||||
setCurrentError(errMsg);
|
||||
if (Platform.OS === "web") {
|
||||
window.alert(errMsg);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue