From 4a7c54eab86dbd7af11fd80d231bc597a3d664c2 Mon Sep 17 00:00:00 2001 From: Jan-Marlon Leibl Date: Wed, 2 Apr 2025 10:26:11 +0200 Subject: [PATCH] style: format code for consistency and readability --- .../game-result/game-result.component.ts | 3 ++- frontend/src/app/service/user.service.ts | 16 ++++++++-------- .../shared/components/navbar/navbar.component.ts | 9 ++++++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts b/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts index a03ff4e..b76baa5 100644 --- a/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts +++ b/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts @@ -106,7 +106,8 @@ export class GameResultComponent { } getResultMessage(): string { - if (this.gameState === GameState.PLAYER_BLACKJACK) return 'Glückwunsch! Du hast mit einem Blackjack gewonnen!'; + if (this.gameState === GameState.PLAYER_BLACKJACK) + return 'Glückwunsch! Du hast mit einem Blackjack gewonnen!'; if (this.isWin) return 'Glückwunsch! Du hast diese Runde gewonnen.'; if (this.isLoss) return 'Schade! Du hast diese Runde verloren.'; if (this.isDraw) return 'Diese Runde endet unentschieden. Dein Einsatz wurde zurückgegeben.'; diff --git a/frontend/src/app/service/user.service.ts b/frontend/src/app/service/user.service.ts index c42ebce..2ad53ce 100644 --- a/frontend/src/app/service/user.service.ts +++ b/frontend/src/app/service/user.service.ts @@ -20,14 +20,14 @@ export class UserService { public getUser(id: string): Observable { return this.http.get(`/backend/user/${id}`).pipe( catchError(() => EMPTY), - tap(user => this.currentUserSubject.next(user)) + tap((user) => this.currentUserSubject.next(user)) ); } public getCurrentUser(): Observable { return this.http.get('/backend/user').pipe( catchError(() => EMPTY), - tap(user => this.currentUserSubject.next(user)) + tap((user) => this.currentUserSubject.next(user)) ); } @@ -36,12 +36,12 @@ export class UserService { } public createUser(id: string, username: string): Observable { - return this.http.post('/backend/user', { - keycloakId: id, - username: username, - }).pipe( - tap(user => this.currentUserSubject.next(user)) - ); + return this.http + .post('/backend/user', { + keycloakId: id, + username: username, + }) + .pipe(tap((user) => this.currentUserSubject.next(user))); } public async getOrCreateUser(userProfile: KeycloakProfile) { diff --git a/frontend/src/app/shared/components/navbar/navbar.component.ts b/frontend/src/app/shared/components/navbar/navbar.component.ts index 3211a4e..6b972ac 100644 --- a/frontend/src/app/shared/components/navbar/navbar.component.ts +++ b/frontend/src/app/shared/components/navbar/navbar.component.ts @@ -1,4 +1,11 @@ -import { ChangeDetectionStrategy, Component, inject, OnInit, OnDestroy, signal } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + OnInit, + OnDestroy, + signal, +} from '@angular/core'; import { RouterModule } from '@angular/router'; import { KeycloakService } from 'keycloak-angular'; import { CurrencyPipe } from '@angular/common';