import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { RouterOutlet } from '@angular/router'; import { AdminSessionService } from './admin-session.service'; import { OperationsService } from './operations.service'; @Component({ selector: 'app-root', standalone: true, imports: [RouterOutlet], template: '', styles: ':host { display: block; min-height: 100%; }', changeDetection: ChangeDetectionStrategy.OnPush, }) export class AppComponent { constructor() { const sessions = inject(AdminSessionService); const operations = inject(OperationsService); if (sessions.isAuthenticated() && globalThis.location.pathname === '/admin/dashboard') { void operations.dashboard().catch(() => undefined); } } }