[menu] handle logout without reload, show signin in sidebar when not logged in
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<app-menu *ngIf="servicesEnabled"></app-menu>
|
||||
<app-menu *ngIf="servicesEnabled" (loggedOut)="onLoggedOut()"></app-menu>
|
||||
|
||||
<ng-container *ngIf="{ val: network$ | async } as network">
|
||||
<header *ngIf="headerVisible" style="position: fixed; width: 100%; z-index: 100;">
|
||||
|
||||
@@ -59,7 +59,7 @@ export class MasterPageComponent implements OnInit {
|
||||
});
|
||||
|
||||
this.servicesEnabled = this.officialMempoolSpace && this.stateService.env.ACCELERATOR === true && this.stateService.network === '';
|
||||
this.userAuth = JSON.parse(localStorage.getItem('auth') || '') ?? null;
|
||||
this.refreshAuth();
|
||||
}
|
||||
|
||||
collapse(): void {
|
||||
@@ -74,6 +74,14 @@ export class MasterPageComponent implements OnInit {
|
||||
this.stateService.resetScroll$.next(true);
|
||||
}
|
||||
|
||||
onLoggedOut() {
|
||||
this.refreshAuth();
|
||||
}
|
||||
|
||||
refreshAuth(): void {
|
||||
this.userAuth = JSON.parse(localStorage.getItem('auth') || '') ?? null;
|
||||
}
|
||||
|
||||
hamburgerClick(): void {
|
||||
if (this.menuComponent) {
|
||||
this.menuComponent.hambugerClick();
|
||||
|
||||
Reference in New Issue
Block a user