save and display options

This commit is contained in:
SpikeHD 2022-04-21 15:15:52 -07:00
parent 0ab11044b3
commit 3c8a983915
2 changed files with 17 additions and 3 deletions

View File

@ -16,9 +16,9 @@
</div>
<div class="settingsRow">
<span class="settingLabel">Kill Switch</span>
<input type="checkbox" id="killswitchOption" />
<input type="checkbox" id="killswitchOption" onchange="toggleKillSwitch()" />
<span class="settingSubtitle">
Only for those very paranoid about bans. Kills the game *and your internet* if something happens to the proxy
Only for those very paranoid about bans. Kills the game process *and your internet* if something happens to the proxy.
</span>
</div>
</div>

View File

@ -301,11 +301,25 @@ async function setFavorite() {
async function openSettings() {
const settings = document.querySelector('#settingsPanel')
const settingsBtn = document.querySelector('#settingsBtn')
const config = await getCfg()
if (settings.style.display === 'none') {
settings.style.removeProperty('display')
}
// Fill setting options with what is currently set in config
const killSwitch = document.querySelector('#killswitchOption')
killSwitch.checked = config.enableKillswitch
}
async function toggleKillSwitch() {
const killSwitch = document.querySelector('#killswitchOption')
const config = await getCfg()
config.enableKillswitch = killSwitch.checked
Neutralino.storage.setData('config', JSON.stringify(config))
}
/**