From 3aa87cc26fd58836b82c067b58a47e08e30a7784 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Thu, 4 Jun 2020 00:18:50 +0800
Subject: refactor(front): Make codes lint-clean!

---
 Timeline/ClientApp/src/settings/Settings.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'Timeline/ClientApp/src/settings/Settings.tsx')

diff --git a/Timeline/ClientApp/src/settings/Settings.tsx b/Timeline/ClientApp/src/settings/Settings.tsx
index b3996fdc..075f8699 100644
--- a/Timeline/ClientApp/src/settings/Settings.tsx
+++ b/Timeline/ClientApp/src/settings/Settings.tsx
@@ -6,12 +6,13 @@ import { Container, Row, Col, Input } from 'reactstrap';
 
 import { apiBaseUrl } from '../config';
 
-import { useUser, userLogout } from '../data/user';
+import { useUser, userLogout, useUserLoggedIn } from '../data/user';
 
 import AppBar from '../common/AppBar';
 import OperationDialog, {
   OperationInputErrorInfo,
 } from '../common/OperationDialog';
+import { CommonErrorResponse } from '../data/common';
 
 interface ChangePasswordDialogProps {
   open: boolean;
@@ -30,7 +31,7 @@ async function changePassword(
       newPassword,
     });
   } catch (e) {
-    const error = e as AxiosError;
+    const error = e as AxiosError<CommonErrorResponse>;
     if (
       error.response &&
       error.response.status === 400 &&
@@ -44,7 +45,7 @@ async function changePassword(
 }
 
 const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props) => {
-  const user = useUser()!;
+  const user = useUserLoggedIn();
   const history = useHistory();
   const { t } = useTranslation();
 
@@ -176,7 +177,7 @@ const Settings: React.FC = (_) => {
               type="select"
               value={language}
               onChange={(e) => {
-                i18n.changeLanguage(e.target.value);
+                void i18n.changeLanguage(e.target.value);
               }}
             >
               <option value="zh">中文</option>
-- 
cgit v1.2.3

