aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2023-03-07 16:28:43 +0100
committerMiodec <[email protected]>2023-03-07 16:28:43 +0100
commit26cc834a31c0984b12fedd494d458f7bdda48ccb (patch)
tree928a4415d5bd97042ae78cc52e021f581e8b7eea
parent4d73c306d42bdb81e640f5096cef0948f2f61394 (diff)
downloadmonkeytype-26cc834a31c0984b12fedd494d458f7bdda48ccb.tar.gz
monkeytype-26cc834a31c0984b12fedd494d458f7bdda48ccb.zip
moved function to config listener to get rid of an import
-rw-r--r--frontend/src/ts/commandline/lists/font-size.ts4
-rw-r--r--frontend/src/ts/test/test-ui.ts1
2 files changed, 1 insertions, 4 deletions
diff --git a/frontend/src/ts/commandline/lists/font-size.ts b/frontend/src/ts/commandline/lists/font-size.ts
index 7e76c9185..8190adc0d 100644
--- a/frontend/src/ts/commandline/lists/font-size.ts
+++ b/frontend/src/ts/commandline/lists/font-size.ts
@@ -1,5 +1,4 @@
import Config, * as UpdateConfig from "../../config";
-import * as TestUI from "../../test/test-ui";
const commands: MonkeyTypes.Command[] = [
{
@@ -13,9 +12,6 @@ const commands: MonkeyTypes.Command[] = [
exec: (input): void => {
if (!input) return;
UpdateConfig.setFontSize(parseFloat(input));
- setTimeout(() => {
- TestUI.updateWordsHeight(true);
- }, 0); //honestly no clue why it i need to wait for the next event loop to do this
},
},
];
diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts
index df6cbebeb..e18e53596 100644
--- a/frontend/src/ts/test/test-ui.ts
+++ b/frontend/src/ts/test/test-ui.ts
@@ -49,6 +49,7 @@ ConfigEvent.subscribe((eventKey, eventValue) => {
) {
debouncedZipfCheck();
}
+ if (eventKey === "fontSize") updateWordsHeight(true);
if (eventValue === undefined || typeof eventValue !== "boolean") return;
if (eventKey === "flipTestColors") flipColors(eventValue);