changes and improvements
This commit is contained in:
@@ -80,6 +80,8 @@ export default function Account() {
|
||||
const submit = async (password?: string) => {
|
||||
setSubmitLoader(true);
|
||||
|
||||
const load = toast.loading(t("applying_settings"));
|
||||
|
||||
await updateUser.mutateAsync(
|
||||
{
|
||||
...user,
|
||||
@@ -92,6 +94,20 @@ export default function Account() {
|
||||
setEmailChangeVerificationModal(false);
|
||||
}
|
||||
},
|
||||
onSettled: (data, error) => {
|
||||
toast.dismiss(load);
|
||||
|
||||
if (error) {
|
||||
toast.error(error.message);
|
||||
} else {
|
||||
if (data.response.email !== user.email) {
|
||||
toast.success(t("email_change_request"));
|
||||
setEmailChangeVerificationModal(false);
|
||||
}
|
||||
|
||||
toast.success(t("settings_applied"));
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user