Redirect user to 404 page for non-existing player-settings pages

This commit is contained in:
Chris Wilson 2021-07-24 23:20:46 -04:00
parent 71642f494f
commit 153fa16bcf
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,8 @@ window.addEventListener('load', () => {
nameInput.addEventListener('keyup', (event) => updateBaseSetting(event));
nameInput.value = playerSettings.name;
}).catch((error) => {
console.error(error);
const url = new URL(window.location.href);
window.location.replace(`${url.protocol}//${url.hostname}/page-not-found`);
})
});