From 9ec661be35efdc8f0fde7875971fc3d4dd12c276 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Wed, 1 Jul 2026 09:01:00 +0700 Subject: [PATCH] feat(client): replace constructor based DI with inject functions --- .../client/src/app/services/user/user.service.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/client/src/app/services/user/user.service.ts b/apps/client/src/app/services/user/user.service.ts index 2ea75fe09..805993d16 100644 --- a/apps/client/src/app/services/user/user.service.ts +++ b/apps/client/src/app/services/user/user.service.ts @@ -3,7 +3,7 @@ import { Filter, User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { HttpClient } from '@angular/common/http'; -import { DestroyRef, Injectable } from '@angular/core'; +import { DestroyRef, inject, Injectable } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatDialog } from '@angular/material/dialog'; import { ObservableStore } from '@codewithdan/observable-store'; @@ -24,13 +24,13 @@ import { UserStoreState } from './user-store.state'; export class UserService extends ObservableStore { private deviceType: string; - public constructor( - private destroyRef: DestroyRef, - private deviceDetectorService: DeviceDetectorService, - private dialog: MatDialog, - private http: HttpClient, - private webAuthnService: WebAuthnService - ) { + private readonly destroyRef = inject(DestroyRef); + private readonly deviceDetectorService = inject(DeviceDetectorService); + private readonly dialog = inject(MatDialog); + private readonly http = inject(HttpClient); + private readonly webAuthnService = inject(WebAuthnService); + + public constructor() { super({ trackStateHistory: true }); this.setState({ user: undefined }, UserStoreActions.Initialize);