Skip to content

Commit

Permalink
🧰: prevent numerical names from being used as playground names
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman authored and linusha committed Dec 13, 2023
1 parent 122b11c commit b872cb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lively.ide/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export class LivelyWorld extends World {
await this.whenEnvReady();
let worldName;
while (!worldName) {
worldName = await this.prompt(['New Playground\n', {}, 'Enter a name for this Playground:', { fontWeight: 'normal' }], { width: 400, hasFixedPosition: true, forceConfirm: true });
worldName = await this.prompt(['New Playground\n', {}, 'Enter a name for this Playground:', { fontWeight: 'normal' }], { width: 400, hasFixedPosition: true, forceConfirm: true, validate: (input) => !input.match(/^[0-9]+$/), errorMessage: 'No numbers as names!' });
if (await this.isNotUnique(String(worldName))) {
const override = await this.confirm('This Playground name is already taken. Do you want to override it?', {
hasFixedPosition: true, width: 400
Expand Down

0 comments on commit b872cb5

Please sign in to comment.