mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 15:46:04 +08:00
fix(funbox): css not cleared when toggling funbox
This commit is contained in:
parent
8080fa737b
commit
f0debe6eee
1 changed files with 5 additions and 7 deletions
|
@ -9,7 +9,7 @@ import * as FunboxMemory from "./funbox-memory";
|
|||
import { HighlightMode } from "@monkeytype/contracts/schemas/configs";
|
||||
import { Mode } from "@monkeytype/contracts/schemas/shared";
|
||||
import { FunboxName, checkCompatibility } from "@monkeytype/funbox";
|
||||
import { getActiveFunboxes, getActiveFunboxNames } from "./list";
|
||||
import { getActiveFunboxes, getActiveFunboxNames, get } from "./list";
|
||||
import { checkForcedConfig } from "./funbox-validation";
|
||||
|
||||
export function toggleScript(...params: string[]): void {
|
||||
|
@ -51,12 +51,10 @@ export function toggleFunbox(funbox: "none" | FunboxName): boolean {
|
|||
FunboxMemory.load();
|
||||
const e = UpdateConfig.toggleFunbox(funbox, false);
|
||||
|
||||
for (const fb of getActiveFunboxes()) {
|
||||
if (!Config.funbox.includes(funbox)) {
|
||||
fb.functions?.clearGlobal?.();
|
||||
} else {
|
||||
fb.functions?.applyGlobalCSS?.();
|
||||
}
|
||||
if (!getActiveFunboxNames().includes(funbox as FunboxName)) {
|
||||
get(funbox as FunboxName).functions?.clearGlobal?.();
|
||||
} else {
|
||||
get(funbox as FunboxName).functions?.applyGlobalCSS?.();
|
||||
}
|
||||
|
||||
//todo find out what the hell this means
|
||||
|
|
Loading…
Add table
Reference in a new issue