From 42c0d1002f2a663c9e2f3b2d046a190fa80c3a92 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Mon, 21 Jun 2021 17:58:04 +0200 Subject: [PATCH] FIX: no more whitespaces in player names --- front/src/Connexion/LocalUser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Connexion/LocalUser.ts b/front/src/Connexion/LocalUser.ts index c877d119..d240a90e 100644 --- a/front/src/Connexion/LocalUser.ts +++ b/front/src/Connexion/LocalUser.ts @@ -10,7 +10,7 @@ export interface CharacterTexture { export const maxUserNameLength: number = MAX_USERNAME_LENGTH; export function isUserNameValid(value: unknown): boolean { - return typeof value === "string" && value.length > 0 && value.length <= maxUserNameLength && value.indexOf(' ') === -1; + return typeof value === "string" && value.length > 0 && value.length <= maxUserNameLength && /\S/.test(value); } export function areCharacterLayersValid(value: string[] | null): boolean {