refreshing after enabling ads automatically

This commit is contained in:
Jack 2020-11-02 02:56:25 +00:00
parent e7fcab63a4
commit 71396def84
2 changed files with 9 additions and 3 deletions

View file

@ -2744,7 +2744,10 @@
<h1>enable ads</h1>
<div class="text">
If you wish to support me without directly donating you can
enable ads that will be visible at the bottom of the screen
enable ads that will be visible at the bottom of the screen.
Sellout mode also shows ads on both sides of the screen.
<br />
<br />
(changes will take effect after a refresh).
</div>
<div class="buttons">

View file

@ -96,7 +96,7 @@ async function saveConfigToCookie(noDbCheck = false) {
path: "/",
});
restartCount = 0;
if (!noDbCheck) saveConfigToDB();
if (!noDbCheck) await saveConfigToDB();
}
async function saveConfigToDB() {
@ -638,7 +638,10 @@ function setEnableAds(val, nosave) {
val = "off";
}
config.enableAds = val;
if (!nosave) saveConfigToCookie();
if (!nosave)
saveConfigToCookie().then(() => {
setTimeout(location.reload(), 500);
});
}
//flip colors