mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-08 10:00:12 -05:00
Added toast alerts to password panel
This commit is contained in:
@@ -8,6 +8,7 @@ import { editPasswordValidation } from "../../../Validation/validation";
|
||||
import Alert from "../../Alert";
|
||||
import { update } from "../../../Features/Auth/authSlice";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { createToast } from "../../../Utils/toastUtils";
|
||||
|
||||
/**
|
||||
* PasswordPanel component manages the form for editing password.
|
||||
@@ -78,15 +79,23 @@ const PasswordPanel = () => {
|
||||
} else {
|
||||
const action = await dispatch(update({ authToken, localData }));
|
||||
if (action.payload.success) {
|
||||
// TODO: Add toast/notification for password update success
|
||||
createToast({
|
||||
variant: "info",
|
||||
body: "Your password was changed successfully.",
|
||||
hasIcon: false,
|
||||
});
|
||||
setLocalData({
|
||||
password: "",
|
||||
newPassword: "",
|
||||
confirm: "",
|
||||
});
|
||||
} else {
|
||||
// TODO: Add toast/notification for password update rejected
|
||||
// TODO: Check for other errors?
|
||||
createToast({
|
||||
variant: "info",
|
||||
body: "Your password input was incorrect.",
|
||||
hasIcon: false,
|
||||
});
|
||||
setErrors({ password: "*" + action.payload.msg + "." });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ const ProfilePanel = () => {
|
||||
delete: false,
|
||||
});
|
||||
|
||||
//TODO - potentitally remove once image compression functions are implemented
|
||||
//TODO - potentitally remove, will revisit in the future
|
||||
intervalRef.current = setInterval(() => {
|
||||
const buffer = 12;
|
||||
setProgress((prev) => {
|
||||
|
||||
Reference in New Issue
Block a user