Added small fix to prevent spamming the save button
This commit is contained in:
1 parent
7e1ccff00d
commit
e9bab07309
1 file changed
+3
-1
@@ -58,6 +58,7 @@ const ProfilePanel = () => {
|
|||||||
|
|
||||||
// Handles input field changes and performs validation
|
// Handles input field changes and performs validation
|
||||||
const handleChange = (event) => {
|
const handleChange = (event) => {
|
||||||
|
errors["unchanged"] && clearError("unchanged");
|
||||||
const { value, id } = event.target;
|
const { value, id } = event.target;
|
||||||
const name = idToName[id];
|
const name = idToName[id];
|
||||||
setLocalData((prev) => ({
|
setLocalData((prev) => ({
|
||||||
@@ -163,10 +164,11 @@ const ProfilePanel = () => {
|
|||||||
localData.file === undefined
|
localData.file === undefined
|
||||||
) {
|
) {
|
||||||
createToast({
|
createToast({
|
||||||
variant: "error",
|
variant: "warning",
|
||||||
body: "Unable to update profile: No changes detected.",
|
body: "Unable to update profile: No changes detected.",
|
||||||
hasIcon: false,
|
hasIcon: false,
|
||||||
});
|
});
|
||||||
|
setErrors({ unchanged: "unable to update profile" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user