Fixed visibility of top bar's impersonation.

This commit is contained in:
Tom 2025-04-01 21:20:01 +00:00
parent d011571164
commit d69fc68ec1
2 changed files with 9 additions and 3 deletions

View File

@ -5,7 +5,7 @@
</button> </button>
<span>Tom-to-Speech</span> <span>Tom-to-Speech</span>
@if (isTTSLoggedIn) { @if (isLoggedIn) {
<span class="spacer"></span> <span class="spacer"></span>
<div class="links"> <div class="links">
@if (showImpersonation) { @if (showImpersonation) {
@ -19,10 +19,12 @@
} }
</div> </div>
} }
@if (isAdminLoggedIn) {
<button mat-icon-button <button mat-icon-button
(click)="showImpersonation = !showImpersonation"> (click)="showImpersonation = !showImpersonation">
<mat-icon>supervisor_account</mat-icon> <mat-icon>supervisor_account</mat-icon>
</button> </button>
}
</div> </div>
} }
</mat-toolbar> </mat-toolbar>

View File

@ -44,8 +44,12 @@ export class Topbar implements OnDestroy {
} }
} }
get isTTSLoggedIn() { get isLoggedIn() {
return this.client.logged_in; return this.auth.isAuthenticated();
}
get isAdminLoggedIn() {
return this.auth.isAuthenticated() && this.auth.isAdmin();
} }
get username() { get username() {