From 3405e9d98e9e31a656e0da71992e5460874658be Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Fri, 7 Aug 2020 00:30:35 +0800
Subject: Fix lint problem in Settings.

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

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

diff --git a/Timeline/ClientApp/src/app/settings/Settings.tsx b/Timeline/ClientApp/src/app/settings/Settings.tsx
index a247557d..13e6f4f3 100644
--- a/Timeline/ClientApp/src/app/settings/Settings.tsx
+++ b/Timeline/ClientApp/src/app/settings/Settings.tsx
@@ -81,7 +81,7 @@ const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props) => {
         await userService
           .changePassword(oldPassword as string, newPassword as string)
           .toPromise();
-        userService.logout();
+        await userService.logout();
         setRedirect(true);
       }}
       close={() => {
@@ -204,8 +204,9 @@ const Settings: React.FC = (_) => {
                 <ConfirmLogoutDialog
                   toggle={() => setDialog(null)}
                   onConfirm={() => {
-                    userService.logout();
-                    history.push('/');
+                    void userService.logout().then(() => {
+                      history.push('/');
+                    });
                   }}
                 />
               );
-- 
cgit v1.2.3

