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

View File

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