diff --git a/components/Modal/User/ChangePassword.tsx b/components/Modal/User/ChangePassword.tsx index c299a43..a007408 100644 --- a/components/Modal/User/ChangePassword.tsx +++ b/components/Modal/User/ChangePassword.tsx @@ -51,17 +51,19 @@ export default function ChangePassword({ if (response.ok) { toast.success("Settings Applied!"); - if ( - user.email !== account.email || - user.username !== account.username || - user.name !== account.name - ) { + if (user.email !== account.email) { update({ id: data?.user.id, }); signOut(); - } + } else if ( + user.username !== account.username || + user.name !== account.name + ) + update({ + id: data?.user.id, + }); setUser({ ...user, newPassword: undefined }); togglePasswordFormModal(); diff --git a/components/Modal/User/PrivacySettings.tsx b/components/Modal/User/PrivacySettings.tsx index 6047448..ef6cd58 100644 --- a/components/Modal/User/PrivacySettings.tsx +++ b/components/Modal/User/PrivacySettings.tsx @@ -60,17 +60,19 @@ export default function PrivacySettings({ if (response.ok) { toast.success("Settings Applied!"); - if ( - user.email !== account.email || - user.username !== account.username || - user.name !== account.name - ) { + if (user.email !== account.email) { update({ id: data?.user.id, }); signOut(); - } + } else if ( + user.username !== account.username || + user.name !== account.name + ) + update({ + id: data?.user.id, + }); setUser({ ...user, newPassword: undefined }); toggleSettingsModal(); diff --git a/components/Modal/User/ProfileSettings.tsx b/components/Modal/User/ProfileSettings.tsx index 76b5fe4..5716b68 100644 --- a/components/Modal/User/ProfileSettings.tsx +++ b/components/Modal/User/ProfileSettings.tsx @@ -78,17 +78,19 @@ export default function ProfileSettings({ if (response.ok) { toast.success("Settings Applied!"); - if ( - user.email !== account.email || - user.username !== account.username || - user.name !== account.name - ) { + if (user.email !== account.email) { update({ id: data?.user.id, }); signOut(); - } + } else if ( + user.username !== account.username || + user.name !== account.name + ) + update({ + id: data?.user.id, + }); setUser({ ...user, newPassword: undefined }); toggleSettingsModal(); @@ -174,11 +176,9 @@ export default function ProfileSettings({ ) : undefined} - {user.username !== account.username || - user.name !== account.name || - user.email !== account.email ? ( + {user.email !== account.email ? (
- You will need to log back in after you apply the changes. + You will need to log back in after you apply this Email.
) : undefined} diff --git a/pages/choose-username.tsx b/pages/choose-username.tsx index 7c426cb..a3fcfb1 100644 --- a/pages/choose-username.tsx +++ b/pages/choose-username.tsx @@ -35,8 +35,6 @@ export default function Subscribe() { update({ id: data?.user.id, }); - - signOut(); } else toast.error(response.data as string); toast.dismiss(redirectionToast); setSubmitLoader(false); @@ -75,10 +73,6 @@ export default function Subscribe() { className="w-full rounded-md p-2 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" /> - -- Note that you will have to log back in to complete the process. -
Feel free to reach out to us at{" "}