From b89ea2e72451133ca8be185de882aa848c277638 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Wed, 9 Mar 2022 17:55:23 +0800
Subject: ...

---
 FrontEnd/src/views/settings/ChangeNicknameDialog.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'FrontEnd/src/views/settings/ChangeNicknameDialog.tsx')

diff --git a/FrontEnd/src/views/settings/ChangeNicknameDialog.tsx b/FrontEnd/src/views/settings/ChangeNicknameDialog.tsx
index 605796ca..f104818f 100644
--- a/FrontEnd/src/views/settings/ChangeNicknameDialog.tsx
+++ b/FrontEnd/src/views/settings/ChangeNicknameDialog.tsx
@@ -1,5 +1,5 @@
 import { getHttpUserClient } from "@/http/user";
-import { useUserLoggedIn } from "@/services/user";
+import { useUser } from "@/services/user";
 import React from "react";
 
 import OperationDialog from "../common/dailog/OperationDialog";
@@ -10,7 +10,9 @@ export interface ChangeNicknameDialogProps {
 }
 
 const ChangeNicknameDialog: React.FC<ChangeNicknameDialogProps> = (props) => {
-  const user = useUserLoggedIn();
+  const user = useUser();
+
+  if (user == null) return null;
 
   return (
     <OperationDialog
-- 
cgit v1.2.3

