Skip to content

Commit

Permalink
fix: updating password
Browse files Browse the repository at this point in the history
  • Loading branch information
RAZGRIZ219104 committed Jun 14, 2024
1 parent 3892265 commit f9987d9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pages/settings/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const Password = ({ view, setView }: propsType) => {
setNotificationDetail(t("alt-16_update-password-old"));
setNotificationOpen(true);
setNotificationLink(null);
setNewPwd("");
setOldPwd("");
setCfmPwd("");
return;
}
if (userStore.password === createKeccakHash("keccak256").update(newPwd).digest("hex")) {
Expand All @@ -43,6 +46,9 @@ const Password = ({ view, setView }: propsType) => {
setNotificationDetail(t("alt-17_update-password-new"));
setNotificationOpen(true);
setNotificationLink(null);
setNewPwd("");
setOldPwd("");
setCfmPwd("");
return;
}
if (cfmPwd !== newPwd) {
Expand All @@ -51,6 +57,9 @@ const Password = ({ view, setView }: propsType) => {
setNotificationDetail(t("alt-18_update-password-new-not"));
setNotificationOpen(true);
setNotificationLink(null);
setNewPwd("");
setOldPwd("");
setCfmPwd("");
return;
}
setNotificationStatus("success");
Expand All @@ -61,6 +70,9 @@ const Password = ({ view, setView }: propsType) => {
account.wallet === walletEnum.noncustodial
? dispatch(setNonCustodial({ ...nonCustodialStore, password: createKeccakHash("keccak256").update(newPwd).digest("hex") }))
: dispatch(setCustodial({ ...custodialStore, password: createKeccakHash("keccak256").update(newPwd).digest("hex") }));
setNewPwd("");
setOldPwd("");
setCfmPwd("");
}, [account, nonCustodialStore, custodialStore, newPwd, oldPwd, cfmPwd]);
return (
<>
Expand Down

0 comments on commit f9987d9

Please sign in to comment.