Skip to content

Commit

Permalink
Update host listener on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrome committed Nov 3, 2023
1 parent 9cadeec commit 051a566
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/app/features/new-dashboard/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ export class NewDashboardComponent implements OnInit, OnDestroy, OnChanges {
@HostListener('document:click', ['$event.target.id']) onClick(target) {
if (target === 'backToParentLink') {
this.isSelectedWorkplace = false;

this.setWorkplace();
this.workplace = this.primaryEstablishment;
this.isParent = !this.isSelectedWorkplace && this.primaryEstablishment?.isParent;
this.workplace = this.route.snapshot.data.establishment;
//this.setWorkplace();
//this.workplace = this.primaryEstablishment;
//this.isParent = !this.isSelectedWorkplace && this.primaryEstablishment?.isParent;
}
}

ngOnChanges(): void {
this.isSelectedWorkplace = this.establishmentService.getIsSelectedWorkplace();
this.isParent = !this.isSelectedWorkplace && this.primaryEstablishment?.isParent;
this.setWorkplace();
this.workplace = this.route.snapshot.data.establishment;
}

private setWorkplace(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class NewDashboardHeaderComponent implements OnInit {
this.workplaceUid = this.workplace ? this.workplace.uid : null;
this.getHeader();
this.getPermissions();
this.isParent = this.workplace.isParent;
this.isParent = this.workplace?.isParent;

if (this.workplace) {
this.setSubsidiaryCount();
Expand Down

0 comments on commit 051a566

Please sign in to comment.