diff --git a/components/Modal/UserSettings.tsx b/components/Modal/UserSettings.tsx index 3c1b308..31213d2 100644 --- a/components/Modal/UserSettings.tsx +++ b/components/Modal/UserSettings.tsx @@ -84,18 +84,16 @@ export default function UserSettings({ toggleSettingsModal }: Props) { }; const submit = async () => { - console.log(user); - - await updateAccount({ + const response = await updateAccount({ ...user, }); - console.log(account); - setPasswordForm(undefined, undefined); if (user.email !== account.email || user.name !== account.name) update({ email: user.email, name: user.name }); + + if (response) toggleSettingsModal(); }; return ( @@ -104,13 +102,6 @@ export default function UserSettings({ toggleSettingsModal }: Props) {

Profile Settings

- {user.email !== account.email || user.name !== account.name ? ( -

- Note: The page will be refreshed to apply the changes of "Email" or - "Display Name". -

- ) : null} -
diff --git a/store/account.ts b/store/account.ts index bda6a15..ddd13a4 100644 --- a/store/account.ts +++ b/store/account.ts @@ -4,7 +4,6 @@ // You should have received a copy of the GNU General Public License along with this program. If not, see . import { create } from "zustand"; -import { User } from "@prisma/client"; import { AccountSettings } from "@/types/global"; import avatarExists from "@/lib/client/avatarExists";