aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-12-04 16:27:38 +0100
committerMiodec <[email protected]>2024-12-04 16:27:38 +0100
commitf0debe6eee69faedb65a66b9e9ba973dc94f6245 (patch)
treec2456e5b3f7c9098336e9bede88e009d9565995f
parent8080fa737b49227b4cb679061374f12b5c184eb3 (diff)
downloadmonkeytype-f0debe6eee69faedb65a66b9e9ba973dc94f6245.tar.gz
monkeytype-f0debe6eee69faedb65a66b9e9ba973dc94f6245.zip
fix(funbox): css not cleared when toggling funbox
-rw-r--r--frontend/src/ts/test/funbox/funbox.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/frontend/src/ts/test/funbox/funbox.ts b/frontend/src/ts/test/funbox/funbox.ts
index b84423257..0aa9856ed 100644
--- a/frontend/src/ts/test/funbox/funbox.ts
+++ b/frontend/src/ts/test/funbox/funbox.ts
@@ -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