refreshing the page when ad settings change

This commit is contained in:
Jack 2021-08-23 19:58:59 +01:00
parent 65003f8784
commit 2f7212e3db
2 changed files with 7 additions and 4 deletions

View file

@ -1040,7 +1040,6 @@ export let commandsEnableAds = {
configValue: "off",
exec: () => {
UpdateConfig.setEnableAds("off");
Notifications.add("Don't forget to refresh the page!", 0);
},
},
{
@ -1049,7 +1048,6 @@ export let commandsEnableAds = {
configValue: "on",
exec: () => {
UpdateConfig.setEnableAds("on");
Notifications.add("Don't forget to refresh the page!", 0);
},
},
{
@ -1058,7 +1056,6 @@ export let commandsEnableAds = {
configValue: "max",
exec: () => {
UpdateConfig.setEnableAds("max");
Notifications.add("Don't forget to refresh the page!", 0);
},
},
],

View file

@ -669,7 +669,13 @@ export function setEnableAds(val, nosave) {
val = "off";
}
config.enableAds = val;
if (!nosave) saveToLocalStorage();
if (!nosave) {
saveToLocalStorage();
setTimeout(() => {
location.reload();
}, 3000);
Notifications.add("Ad settings changed. Refreshing...", 0);
}
}
export function setRepeatQuotes(val, nosave) {