Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

The error in the background is potentially confusing too

Manav Rathiedceebd8fbb6
diff --git a/web/packages/shared/components/VerifyMasterPasswordForm.tsx b/web/packages/shared/components/VerifyMasterPasswordForm.tsx
index 473918b832..73a194fdb0 100644
--- a/web/packages/shared/components/VerifyMasterPasswordForm.tsx
+++ b/web/packages/shared/components/VerifyMasterPasswordForm.tsx
@@ -32,7 +32,8 @@ export interface VerifyMasterPasswordFormProps {
/**
* Called when the user enters an incorrect password.
*
- * Optional.
+ * Optional. If present, this function will be called _instead_ of
+ * performing the default behaviour (showing an "incorrect password" error).
*/
onIncorrectPassword?: () => void;
}
@@ -104,8 +105,8 @@ export default function VerifyMasterPasswordForm({
setFieldError(t("WEAK_DEVICE"));
break;
case CustomError.INCORRECT_PASSWORD:
- setFieldError(t("INCORRECT_PASSPHRASE"));
- onIncorrectPassword && onIncorrectPassword();
+ if (onIncorrectPassword) onIncorrectPassword();
+ else setFieldError(t("INCORRECT_PASSPHRASE"));
break;
default:
setFieldError(`${t("UNKNOWN_ERROR")} ${e.message}`);