style: Clean up whitespace in component files
All checks were successful
CI / Get Changed Files (pull_request) Successful in 9s
CI / Docker backend validation (pull_request) Successful in 12s
CI / eslint (pull_request) Successful in 35s
CI / Docker frontend validation (pull_request) Successful in 52s
CI / oxlint (pull_request) Successful in 25s
CI / Checkstyle Main (pull_request) Successful in 55s
CI / prettier (pull_request) Successful in 21s
CI / test-build (pull_request) Successful in 31s

This commit is contained in:
Jan-Marlon Leibl 2025-05-07 17:56:12 +02:00
commit 205bf1e52c
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
3 changed files with 9 additions and 9 deletions

View file

@ -57,7 +57,7 @@ export default class BlackjackComponent implements OnInit {
this.balance.set(user.balance); this.balance.set(user.balance);
} }
}); });
// Subscribe to user updates for real-time balance changes // Subscribe to user updates for real-time balance changes
this.userService.currentUser$.subscribe((user) => { this.userService.currentUser$.subscribe((user) => {
if (user) { if (user) {
@ -92,7 +92,7 @@ export default class BlackjackComponent implements OnInit {
if (isGameOver) { if (isGameOver) {
console.log('Game is over, state:', game.state); console.log('Game is over, state:', game.state);
this.userService.refreshCurrentUser(); this.userService.refreshCurrentUser();
// Get the latest balance before showing the result dialog // Get the latest balance before showing the result dialog
timer(1000).subscribe(() => { timer(1000).subscribe(() => {
this.userService.getCurrentUser().subscribe((user) => { this.userService.getCurrentUser().subscribe((user) => {
@ -183,7 +183,7 @@ export default class BlackjackComponent implements OnInit {
this.blackjackService.doubleDown(this.currentGameId()!).subscribe({ this.blackjackService.doubleDown(this.currentGameId()!).subscribe({
next: (game) => { next: (game) => {
this.updateGameState(game); this.updateGameState(game);
// Wait a bit to ensure the backend has finished processing // Wait a bit to ensure the backend has finished processing
timer(1000).subscribe(() => { timer(1000).subscribe(() => {
this.userService.getCurrentUser().subscribe((user) => { this.userService.getCurrentUser().subscribe((user) => {
@ -196,7 +196,7 @@ export default class BlackjackComponent implements OnInit {
} }
}); });
}); });
this.isActionInProgress.set(false); this.isActionInProgress.set(false);
}, },
error: (error) => { error: (error) => {
@ -210,7 +210,7 @@ export default class BlackjackComponent implements OnInit {
onCloseGameResult(): void { onCloseGameResult(): void {
console.log('Closing game result dialog'); console.log('Closing game result dialog');
this.showGameResult.set(false); this.showGameResult.set(false);
// Refresh the balance when dialog is closed and update local state // Refresh the balance when dialog is closed and update local state
this.userService.getCurrentUser().subscribe((user) => { this.userService.getCurrentUser().subscribe((user) => {
if (user) { if (user) {

View file

@ -109,13 +109,13 @@ export default class SlotsComponent implements OnInit, OnDestroy {
next: (result) => { next: (result) => {
setTimeout(() => { setTimeout(() => {
this.slotResult.set(result); this.slotResult.set(result);
if (result.status === 'win') { if (result.status === 'win') {
this.userService.updateLocalBalance(result.amount); this.userService.updateLocalBalance(result.amount);
} }
this.userService.refreshCurrentUser(); this.userService.refreshCurrentUser();
this.isSpinning = false; this.isSpinning = false;
}, 1500); }, 1500);
}, },

View file

@ -21,7 +21,7 @@ export class UserService {
} }
// Subscribe to auth service user updates // Subscribe to auth service user updates
this.authService.userSubject.subscribe(user => { this.authService.userSubject.subscribe((user) => {
this.currentUserSubject.next(user); this.currentUserSubject.next(user);
}); });
} }