Skip to content

Commit f0debe6

Browse files
committed
fix(funbox): css not cleared when toggling funbox
1 parent 8080fa7 commit f0debe6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

frontend/src/ts/test/funbox/funbox.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as FunboxMemory from "./funbox-memory";
99
import { HighlightMode } from "@monkeytype/contracts/schemas/configs";
1010
import { Mode } from "@monkeytype/contracts/schemas/shared";
1111
import { FunboxName, checkCompatibility } from "@monkeytype/funbox";
12-
import { getActiveFunboxes, getActiveFunboxNames } from "./list";
12+
import { getActiveFunboxes, getActiveFunboxNames, get } from "./list";
1313
import { checkForcedConfig } from "./funbox-validation";
1414

1515
export function toggleScript(...params: string[]): void {
@@ -51,12 +51,10 @@ export function toggleFunbox(funbox: "none" | FunboxName): boolean {
5151
FunboxMemory.load();
5252
const e = UpdateConfig.toggleFunbox(funbox, false);
5353

54-
for (const fb of getActiveFunboxes()) {
55-
if (!Config.funbox.includes(funbox)) {
56-
fb.functions?.clearGlobal?.();
57-
} else {
58-
fb.functions?.applyGlobalCSS?.();
59-
}
54+
if (!getActiveFunboxNames().includes(funbox as FunboxName)) {
55+
get(funbox as FunboxName).functions?.clearGlobal?.();
56+
} else {
57+
get(funbox as FunboxName).functions?.applyGlobalCSS?.();
6058
}
6159

6260
//todo find out what the hell this means

0 commit comments

Comments
 (0)