Skip to content

Commit 74d54ac

Browse files
authored
fix: compatibility check for funboxes when switching test modes (@fehmer) (monkeytypegame#6471)
1 parent ff10bac commit 74d54ac

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

frontend/src/ts/test/funbox/funbox-validation.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ export function canSetConfigWithCurrentFunboxes(
8787
fb = fb.concat(
8888
getFunboxesFromString(funbox).filter((f) => {
8989
return (
90-
f.frontendFunctions?.includes("getWord") ??
91-
f.frontendFunctions?.includes("pullSection") ??
92-
f.frontendFunctions?.includes("alterText") ??
93-
f.frontendFunctions?.includes("withWords") ??
94-
f.properties?.includes("changesCapitalisation") ??
95-
f.properties?.includes("nospace") ??
96-
f.properties?.find((fp) => fp.startsWith("toPush:")) ??
97-
f.properties?.includes("changesWordsVisibility") ??
98-
f.properties?.includes("speaks") ??
99-
f.properties?.includes("changesLayout") ??
90+
f.frontendFunctions?.includes("getWord") ||
91+
f.frontendFunctions?.includes("pullSection") ||
92+
f.frontendFunctions?.includes("alterText") ||
93+
f.frontendFunctions?.includes("withWords") ||
94+
f.properties?.includes("changesCapitalisation") ||
95+
f.properties?.includes("nospace") ||
96+
f.properties?.some((fp) => fp.startsWith("toPush:")) ||
97+
f.properties?.includes("changesWordsVisibility") ||
98+
f.properties?.includes("speaks") ||
99+
f.properties?.includes("changesLayout") ||
100100
f.properties?.includes("changesWordsFrequency")
101101
);
102102
})
@@ -106,9 +106,9 @@ export function canSetConfigWithCurrentFunboxes(
106106
fb = fb.concat(
107107
getFunboxesFromString(funbox).filter((f) => {
108108
return (
109-
f.frontendFunctions?.includes("getWord") ??
110-
f.frontendFunctions?.includes("pullSection") ??
111-
f.frontendFunctions?.includes("withWords") ??
109+
f.frontendFunctions?.includes("getWord") ||
110+
f.frontendFunctions?.includes("pullSection") ||
111+
f.frontendFunctions?.includes("withWords") ||
112112
f.properties?.includes("changesWordsFrequency")
113113
);
114114
})

0 commit comments

Comments
 (0)