mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-09 18:05:09 +00:00
Fix logout bug. Fixes #391
This commit is contained in:
parent
8f132f67fa
commit
de42608816
|
@ -429,7 +429,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
handleLogoutClick(i: Navbar) {
|
handleLogoutClick(i: Navbar) {
|
||||||
i.setState({ showDropdown: false, expanded: false });
|
i.setState({ showDropdown: false, expanded: false });
|
||||||
UserService.Instance.logout();
|
UserService.Instance.logout();
|
||||||
i.context.router.history.push("/");
|
window.location.href = "/";
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1035,9 +1035,10 @@ export class Settings extends Component<any, SettingsState> {
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleLogoutClick(i: Settings) {
|
handleLogoutClick(_i: Settings) {
|
||||||
UserService.Instance.logout();
|
UserService.Instance.logout();
|
||||||
i.context.router.history.push("/");
|
window.location.href = "/";
|
||||||
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDeleteAccount(i: Settings, event: any) {
|
handleDeleteAccount(i: Settings, event: any) {
|
||||||
|
@ -1119,6 +1120,7 @@ export class Settings extends Component<any, SettingsState> {
|
||||||
});
|
});
|
||||||
UserService.Instance.logout();
|
UserService.Instance.logout();
|
||||||
window.location.href = "/";
|
window.location.href = "/";
|
||||||
|
location.reload();
|
||||||
} else if (op == UserOperation.BlockPerson) {
|
} else if (op == UserOperation.BlockPerson) {
|
||||||
let data = wsJsonToRes<BlockPersonResponse>(msg).data;
|
let data = wsJsonToRes<BlockPersonResponse>(msg).data;
|
||||||
this.setState({ personBlocks: updatePersonBlock(data) });
|
this.setState({ personBlocks: updatePersonBlock(data) });
|
||||||
|
|
|
@ -37,7 +37,7 @@ export class UserService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public logout() {
|
public logout() {
|
||||||
IsomorphicCookie.remove("jwt", { secure: false });
|
IsomorphicCookie.remove("jwt");
|
||||||
this.claims = undefined;
|
this.claims = undefined;
|
||||||
this.myUserInfo = undefined;
|
this.myUserInfo = undefined;
|
||||||
// setTheme();
|
// setTheme();
|
||||||
|
|
Loading…
Reference in a new issue