Fix player-options and weighted-options failing to validate settings if a payer's name is entirely numeric (#2496)
This commit is contained in:
parent
15797175c7
commit
e64c7b1cbb
|
@ -463,7 +463,7 @@ const exportOptions = () => {
|
||||||
options['description'] = `Generated by https://archipelago.gg with the ${preset} preset.`;
|
options['description'] = `Generated by https://archipelago.gg with the ${preset} preset.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!options.name || options.name.trim().length === 0) {
|
if (!options.name || options.name.toString().trim().length === 0) {
|
||||||
return showUserMessage('You must enter a player name!');
|
return showUserMessage('You must enter a player name!');
|
||||||
}
|
}
|
||||||
const yamlText = jsyaml.safeDump(options, { noCompatMode: true }).replaceAll(/'(\d+)':/g, (x, y) => `${y}:`);
|
const yamlText = jsyaml.safeDump(options, { noCompatMode: true }).replaceAll(/'(\d+)':/g, (x, y) => `${y}:`);
|
||||||
|
|
|
@ -210,7 +210,11 @@ class WeightedSettings {
|
||||||
let errorMessage = null;
|
let errorMessage = null;
|
||||||
|
|
||||||
// User must choose a name for their file
|
// User must choose a name for their file
|
||||||
if (!settings.name || settings.name.trim().length === 0 || settings.name.toLowerCase().trim() === 'player') {
|
if (
|
||||||
|
!settings.name ||
|
||||||
|
settings.name.toString().trim().length === 0 ||
|
||||||
|
settings.name.toString().toLowerCase().trim() === 'player'
|
||||||
|
) {
|
||||||
userMessage.innerText = 'You forgot to set your player name at the top of the page!';
|
userMessage.innerText = 'You forgot to set your player name at the top of the page!';
|
||||||
userMessage.classList.add('visible');
|
userMessage.classList.add('visible');
|
||||||
userMessage.scrollIntoView({
|
userMessage.scrollIntoView({
|
||||||
|
|
Loading…
Reference in New Issue