mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 14:10:59 +08:00
Hide/show setting when user locks/unlocks the feature
Also reset powerLevel on show to 9001
This commit is contained in:
parent
d2f07245a2
commit
fedbade8cf
1 changed files with 6 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ import * as PaceCaret from "./pace-caret";
|
|||
import * as UI from "./ui";
|
||||
import * as CommandlineLists from "./commandline-lists";
|
||||
import * as BackgroundFilter from "./custom-background-filter";
|
||||
import * as Settings from "./settings";
|
||||
import LayoutList from "./layouts";
|
||||
|
||||
export let localStorageConfig = null;
|
||||
|
|
@ -1488,6 +1489,11 @@ export function setCustomBackgroundFilter(array, nosave) {
|
|||
export function setMonkeyPowerUnlocked(val, nosave) {
|
||||
if (val !== true) val = false;
|
||||
config.monkeyPowerUnlocked = val;
|
||||
|
||||
if (val) setMonkeyPowerLevel(9001);
|
||||
Settings.groups.monkeyPowerLevel?.updateButton();
|
||||
$(".section.monkeyPowerLevel")[val ? "removeClass" : "addClass"]("hidden");
|
||||
|
||||
if (!nosave) saveToLocalStorage();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue