|
|
|
|
@@ -4,6 +4,7 @@ import { Component } from '@angular/core';
|
|
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
|
|
import { NavigationEnd, Router, RouterModule } from '@angular/router';
|
|
|
|
|
import { faUserGear } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
|
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
|
|
|
|
|
import { Collapse, Dropdown, initFlowbite } from 'flowbite';
|
|
|
|
|
import { KeycloakService } from 'keycloak-angular';
|
|
|
|
|
import { filter, Observable, Subject, Subscription } from 'rxjs';
|
|
|
|
|
@@ -17,6 +18,7 @@ import { UserService } from '../../services/user.service';
|
|
|
|
|
import { assignProperties, compareObjects, createEmptyBusinessListingCriteria, createEmptyCommercialPropertyListingCriteria, createEmptyUserListingCriteria, getCriteriaProxy, map2User } from '../../utils/utils';
|
|
|
|
|
import { DropdownComponent } from '../dropdown/dropdown.component';
|
|
|
|
|
import { ModalService } from '../search-modal/modal.service';
|
|
|
|
|
@UntilDestroy()
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'header',
|
|
|
|
|
standalone: true,
|
|
|
|
|
@@ -75,6 +77,12 @@ export class HeaderComponent {
|
|
|
|
|
this.routerSubscription = this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe((event: any) => {
|
|
|
|
|
this.checkCurrentRoute(event.urlAfterRedirects);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.userService.currentUser.pipe(untilDestroyed(this)).subscribe(u => {
|
|
|
|
|
if (u !== undefined) {
|
|
|
|
|
this.user = u;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
private checkCurrentRoute(url: string): void {
|
|
|
|
|
this.baseRoute = url.split('/')[1]; // Nimmt den ersten Teil der Route nach dem ersten '/'
|
|
|
|
|
|