From: Dessalines <tyhou13@gmx.com>
Date: Thu, 6 May 2021 16:05:34 +0000 (-0400)
Subject: Fixing delete acct logout bug.
X-Git-Url: http://these/git/%22https:/image.com/static/readmes/%7Burl%7D?a=commitdiff_plain;h=277cd2ac37d61224dfd165769e73c7751488e1bb;p=lemmy-ui.git

Fixing delete acct logout bug.
---

diff --git a/src/shared/components/person.tsx b/src/shared/components/person.tsx
index 53de754..5ded454 100644
--- a/src/shared/components/person.tsx
+++ b/src/shared/components/person.tsx
@@ -1179,7 +1179,6 @@ export class Person extends Component<any, PersonState> {
     WebSocketService.Instance.send(
       wsClient.deleteAccount(i.state.deleteAccountForm)
     );
-    i.handleLogoutClick(i);
   }
 
   setUserInfo() {
@@ -1273,7 +1272,8 @@ export class Person extends Component<any, PersonState> {
         deleteAccountLoading: false,
         deleteAccountShowConfirm: false,
       });
-      this.context.router.history.push("/");
+      UserService.Instance.logout();
+      window.location.href = "/";
     } else if (op == UserOperation.AddAdmin) {
       let data = wsJsonToRes<AddAdminResponse>(msg).data;
       this.state.siteRes.admins = data.admins;