refactor(auth): replace UserService with AuthService usage
Some checks failed
CI / Get Changed Files (pull_request) Successful in 37s
CI / Docker backend validation (pull_request) Successful in 14s
CI / Docker frontend validation (pull_request) Successful in 51s
CI / eslint (pull_request) Successful in 42s
CI / oxlint (pull_request) Successful in 32s
CI / Checkstyle Main (pull_request) Successful in 1m2s
CI / prettier (pull_request) Failing after 27s
CI / test-build (pull_request) Successful in 59s
Some checks failed
CI / Get Changed Files (pull_request) Successful in 37s
CI / Docker backend validation (pull_request) Successful in 14s
CI / Docker frontend validation (pull_request) Successful in 51s
CI / eslint (pull_request) Successful in 42s
CI / oxlint (pull_request) Successful in 32s
CI / Checkstyle Main (pull_request) Successful in 1m2s
CI / prettier (pull_request) Failing after 27s
CI / test-build (pull_request) Successful in 59s
This commit is contained in:
parent
205bf1e52c
commit
226675de03
6 changed files with 38 additions and 86 deletions
|
@ -13,6 +13,7 @@ import { FormsModule } from '@angular/forms';
|
|||
import { UserService } from '@service/user.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { AnimatedNumberComponent } from '@blackjack/components/animated-number/animated-number.component';
|
||||
import { AuthService } from '@service/auth.service';
|
||||
|
||||
interface SlotResult {
|
||||
status: 'win' | 'lose' | 'blank' | 'start';
|
||||
|
@ -39,6 +40,7 @@ interface SlotResult {
|
|||
export default class SlotsComponent implements OnInit, OnDestroy {
|
||||
private httpClient: HttpClient = inject(HttpClient);
|
||||
private userService = inject(UserService);
|
||||
private authService = inject(AuthService);
|
||||
private userSubscription: Subscription | undefined;
|
||||
|
||||
slotInfo = signal<Record<string, number> | null>(null);
|
||||
|
@ -61,7 +63,7 @@ export default class SlotsComponent implements OnInit, OnDestroy {
|
|||
this.slotInfo.set(data);
|
||||
});
|
||||
|
||||
this.userSubscription = this.userService.getCurrentUser().subscribe((user) => {
|
||||
this.userSubscription = this.authService.userSubject.subscribe((user) => {
|
||||
this.balance.set(user?.balance ?? 0);
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue