Skip to content

Commit

Permalink
fix(funbox): css not cleared when toggling funbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Dec 4, 2024
1 parent 8080fa7 commit f0debe6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions frontend/src/ts/test/funbox/funbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f0debe6

Please sign in to comment.