From 300305f1c44a532eee43fb1111650ac50e0ad9cb Mon Sep 17 00:00:00 2001 From: zumbiepig <121742281+zumbiepig@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:37:07 -0700 Subject: [PATCH] . --- public/settings/index.html | 2 +- src/resources/scripts/settings.ts | 25 ++++--------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/public/settings/index.html b/public/settings/index.html index be16c77..e661135 100644 --- a/public/settings/index.html +++ b/public/settings/index.html @@ -75,7 +75,7 @@ -->
- +
diff --git a/src/resources/scripts/settings.ts b/src/resources/scripts/settings.ts index c77f193..382181f 100644 --- a/src/resources/scripts/settings.ts +++ b/src/resources/scripts/settings.ts @@ -7,10 +7,9 @@ if (window.location.pathname === '/settings/') { const adsCheckbox = document.getElementById('ads-checkbox') as HTMLInputElement; usernameInput.placeholder = storage.local.get('username') ?? ''; - themeSelect.value = storage.local.get('theme') ?? 'default'; + themeSelect.value = storage.local.get('theme') ?? ''; // offlineCheckbox.checked = storage.local.get('offlineCache') ?? false; - const showAds = storage.local.get('showAds'); - adsCheckbox.checked = showAds === null ? true : showAds; + adsCheckbox.checked = storage.local.get('showAds'); usernameInput.addEventListener('input', () => { let username = usernameInput.value.replace(/[^A-Za-z0-9]/g, '_').substring(0, 16); @@ -42,24 +41,8 @@ if (window.location.pathname === '/settings/') { }); */ adsCheckbox.addEventListener('change', () => { - if (adsCheckbox.checked === false) { - if ( - prompt( - 'Ads are the only source of income for this project, and they help keep the servers running.\n\nIf you really want to disable ads, join the Discord server and get the password to disable ads.' - ) === 'zombie' - ) { - storage.local.set('showAds', false); - alert('Ads have successfully been disabled.'); - window.location.reload(); - } else { - alert('Wrong password. Join the Discord server to get the password.'); - adsCheckbox.checked = true; - } - } else { - storage.local.set('showAds', true); - alert('Ads have been enabled. Thank you for supporting the project!'); - window.location.reload(); - } + storage.local.set('showAds', adsCheckbox.checked); + window.location.reload(); }); }); }