[menu] fix non clickable hamburger when logged out

This commit is contained in:
nymkappa 2023-08-23 11:50:47 +02:00
parent 8fb566858f
commit b333c211f7
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 4 additions and 3 deletions

View File

@ -4,11 +4,11 @@
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<!-- Hamburger -->
<ng-container *ngIf="servicesEnabled">
<div *ngIf="user" class="profile_image_container" [class]="{'anon': !user.imageMd5}" (click)="hamburgerClick()">
<div *ngIf="user" class="profile_image_container" [class]="{'anon': !user.imageMd5}" (click)="hamburgerClick($event)">
<img *ngIf="user.imageMd5" [src]="'/api/v1/services/account/image/' + user.username + '?md5=' + user.imageMd5" class="profile_image">
<app-svg-images style="color: lightgrey; fill: lightgray" *ngIf="!user.imageMd5" name="anon"></app-svg-images>
</div>
<div *ngIf="user === null" class="profile_image_container" (click)="hamburgerClick()">
<div *ngIf="user === null" class="profile_image_container" (click)="hamburgerClick($event)">
<app-svg-images name="hamburger" height="40"></app-svg-images>
</div>
<!-- Empty placeholder -->

View File

@ -87,9 +87,10 @@ export class MasterPageComponent implements OnInit {
this.apiService.getUserInfo$().subscribe(user => this.user = user);
}
hamburgerClick(): void {
hamburgerClick(event): void {
if (this.menuComponent) {
this.menuComponent.hambugerClick();
event.stopPropagation();
}
}
}