1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-09 16:21:51 +00:00

Fixed missed trim replacement (#9)

This commit is contained in:
Thomas (DJ1TJOO) 2023-03-05 20:01:10 +01:00 committed by GitHub
parent ddb904432e
commit 77fb9b76b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -708,7 +708,7 @@ export class MainMenuState extends GameState {
label: null, label: null,
placeholder: "", placeholder: "",
defaultValue: game.name || "", defaultValue: game.name || "",
validator: val => val.match(regex) && trim(val).length > 0, validator: val => val.match(regex) && val.trim().length > 0,
}); });
const dialog = new DialogWithForm({ const dialog = new DialogWithForm({
app: this.app, app: this.app,
@ -717,6 +717,7 @@ export class MainMenuState extends GameState {
formElements: [nameInput], formElements: [nameInput],
buttons: ["cancel:bad:escape", "ok:good:enter"], buttons: ["cancel:bad:escape", "ok:good:enter"],
}); });
this.dialogs.internalShowDialog(dialog); this.dialogs.internalShowDialog(dialog);
// When confirmed, save the name // When confirmed, save the name