From becf7835fe516a6d6e5de393d681713ec65ef10a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 17 Sep 2025 21:22:12 +0200 Subject: [PATCH] fix: Fixed compile issues after upgrade --- src/app/user/user.component.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/user/user.component.ts b/src/app/user/user.component.ts index 4e62e966..4919f1cf 100644 --- a/src/app/user/user.component.ts +++ b/src/app/user/user.component.ts @@ -1,6 +1,9 @@ import { Component } from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { Validators } from '@angular/forms'; +import { + FormControl, + Validators, + ValidationErrors, +} from '@angular/forms'; import { Router } from "@angular/router"; import { UserService } from "./user.service"; @@ -14,17 +17,17 @@ export class UserComponent { usernameForm = new FormControl('', [ Validators.required, this.noWhitespaceValidator ]); updateName(): void { - var input = this.usernameForm.getRawValue(); + let input = this.usernameForm.getRawValue(); if (input !== null) { this.userService.setUser(input.trim()); this.router.navigate(['chatrooms']) } } - noWhitespaceValidator(control: FormControl) { + noWhitespaceValidator(control: FormControl) : ValidationErrors { const isWhitespace = (control.value || '').trim().length === 0; const isValid = !isWhitespace; - return isValid ? null : { 'whitespace': true }; + return isValid ? {} : { 'whitespace': true }; } constructor( -- 2.39.5