From f15bb9dbd7b61b8174c25c26c631462c70f32d7a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 25 Jul 2021 18:07:03 -0400 Subject: [PATCH] Fix player-settings not defaulting the select options to their proper values. Also fix tab title. --- WebHostLib/static/assets/player-settings.js | 8 +++++--- WebHostLib/templates/player-settings.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/WebHostLib/static/assets/player-settings.js b/WebHostLib/static/assets/player-settings.js index 45c577fe..111a6d84 100644 --- a/WebHostLib/static/assets/player-settings.js +++ b/WebHostLib/static/assets/player-settings.js @@ -24,7 +24,7 @@ window.addEventListener('load', () => { nameInput.value = playerSettings.name; }).catch((error) => { const url = new URL(window.location.href); - // window.location.replace(`${url.protocol}//${url.hostname}/page-not-found`); + window.location.replace(`${url.protocol}//${url.hostname}/page-not-found`); }) }); @@ -97,8 +97,10 @@ const buildOptionsTable = (settings, romOpts = false) => { const option = document.createElement('option'); option.setAttribute('value', opt.value); option.innerText = opt.name; - if ((isNaN(currentSettings[setting]) && (parseInt(opt.value, 10) === parseInt(currentSettings[setting]))) || - (opt.value === currentSettings[setting])) { + if ((isNaN(currentSettings[gameName][setting]) && + (parseInt(opt.value, 10) === parseInt(currentSettings[gameName][setting]))) || + (opt.value === currentSettings[gameName][setting])) + { option.selected = true; } select.appendChild(option); diff --git a/WebHostLib/templates/player-settings.html b/WebHostLib/templates/player-settings.html index 25e343fa..8f40a773 100644 --- a/WebHostLib/templates/player-settings.html +++ b/WebHostLib/templates/player-settings.html @@ -1,7 +1,7 @@ {% extends 'pageWrapper.html' %} {% block head %} - A Link to the Past Settings + {{ game }} Settings