mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-29 01:59:48 +08:00
impr(dev): disable ads in dev
!nuf
This commit is contained in:
parent
f4bfe27175
commit
c6d1ea09cc
1 changed files with 7 additions and 2 deletions
|
@ -15,7 +15,7 @@ import {
|
|||
canSetConfigWithCurrentFunboxes,
|
||||
canSetFunboxWithConfig,
|
||||
} from "./test/funbox/funbox-validation";
|
||||
import { reloadAfter } from "./utils/misc";
|
||||
import { isDevEnvironment, reloadAfter } from "./utils/misc";
|
||||
import * as ConfigTypes from "@monkeytype/shared-types/config";
|
||||
|
||||
export let localStorageConfig: ConfigTypes.Config;
|
||||
|
@ -661,9 +661,14 @@ export function setAds(val: ConfigTypes.Ads, nosave?: boolean): boolean {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (isDevEnvironment()) {
|
||||
val = "off";
|
||||
console.debug("Ads are disabled in dev environment");
|
||||
}
|
||||
|
||||
config.ads = val;
|
||||
saveToLocalStorage("ads", nosave);
|
||||
if (!nosave) {
|
||||
if (!nosave && !isDevEnvironment()) {
|
||||
reloadAfter(3);
|
||||
Notifications.add("Ad settings changed. Refreshing...", 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue