style: format code for consistency and readability
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Successful in 19s
CI / test-build (pull_request) Successful in 27s
CI / prettier (pull_request) Successful in 40s
CI / Checkstyle Main (pull_request) Successful in 1m28s

This commit is contained in:
Jan-Marlon Leibl 2025-04-02 10:26:11 +02:00
parent e983b21e07
commit 4a7c54eab8
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
3 changed files with 18 additions and 10 deletions

View file

@ -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.';

View file

@ -20,14 +20,14 @@ export class UserService {
public getUser(id: string): Observable<User | null> {
return this.http.get<User | null>(`/backend/user/${id}`).pipe(
catchError(() => EMPTY),
tap(user => this.currentUserSubject.next(user))
tap((user) => this.currentUserSubject.next(user))
);
}
public getCurrentUser(): Observable<User | null> {
return this.http.get<User | null>('/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<User> {
return this.http.post<User>('/backend/user', {
keycloakId: id,
username: username,
}).pipe(
tap(user => this.currentUserSubject.next(user))
);
return this.http
.post<User>('/backend/user', {
keycloakId: id,
username: username,
})
.pipe(tap((user) => this.currentUserSubject.next(user)));
}
public async getOrCreateUser(userProfile: KeycloakProfile) {

View file

@ -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';