From 55306aa890dde4f95c04f7cb1c447c58c959c87c Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sat, 23 May 2026 16:10:29 +0700 Subject: [PATCH] feat(client): convert hasImpersonationId to signal --- .../app/components/home-overview/home-overview.component.ts | 6 ++---- .../src/app/components/home-overview/home-overview.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/components/home-overview/home-overview.component.ts b/apps/client/src/app/components/home-overview/home-overview.component.ts index b52850bc7..4c1eae0f9 100644 --- a/apps/client/src/app/components/home-overview/home-overview.component.ts +++ b/apps/client/src/app/components/home-overview/home-overview.component.ts @@ -49,7 +49,7 @@ export class GfHomeOverviewComponent implements OnInit { ); protected readonly errors = signal([]); - protected hasImpersonationId: boolean; + protected readonly hasImpersonationId = signal(false); protected hasPermissionToCreateActivity: boolean; protected historicalDataItems: LineChartItem[] | null; protected isLoadingPerformance = true; @@ -104,9 +104,7 @@ export class GfHomeOverviewComponent implements OnInit { .onChangeHasImpersonation() .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe((impersonationId) => { - this.hasImpersonationId = !!impersonationId; - - this.changeDetectorRef.markForCheck(); + this.hasImpersonationId.set(!!impersonationId); }); this.layoutService.shouldReloadContent$ diff --git a/apps/client/src/app/components/home-overview/home-overview.html b/apps/client/src/app/components/home-overview/home-overview.html index c642c6f18..3ba1c14ff 100644 --- a/apps/client/src/app/components/home-overview/home-overview.html +++ b/apps/client/src/app/components/home-overview/home-overview.html @@ -2,7 +2,7 @@ class="align-items-center container d-flex flex-column h-100 justify-content-center overview p-0 position-relative" > @if ( - !hasImpersonationId && + !hasImpersonationId() && hasPermissionToCreateActivity && user?.activitiesCount === 0 ) {