From 395c7b9e57b2e65e9b9a3b9527a173cb683fde81 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 9 Mar 2022 14:27:50 +0100 Subject: [PATCH] monkey uses raw if blind mode is enabled --- frontend/src/scripts/test/test-timer.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/scripts/test/test-timer.ts b/frontend/src/scripts/test/test-timer.ts index 0b4c9f09e..729f067cd 100644 --- a/frontend/src/scripts/test/test-timer.ts +++ b/frontend/src/scripts/test/test-timer.ts @@ -68,7 +68,8 @@ function calculateWpmRaw(): MonkeyTypes.WordsPerMinuteAndRaw { function monkey(wpmAndRaw: MonkeyTypes.WordsPerMinuteAndRaw): void { if (timerDebug) console.time("update monkey"); - Monkey.updateFastOpacity(wpmAndRaw.wpm); + const num = Config.blindMode ? wpmAndRaw.raw : wpmAndRaw.wpm; + Monkey.updateFastOpacity(num); if (timerDebug) console.timeEnd("update monkey"); } @@ -225,16 +226,18 @@ export async function start(): Promise { slowTimerCount++; if (slowTimerCount > 5) { //slow timer - + if (window.navigator.userAgent.includes("Edg")) { - Notifications.add('This bad performance could be caused by "efficiency mode" on Microsoft Edge.'); + Notifications.add( + 'This bad performance could be caused by "efficiency mode" on Microsoft Edge.' + ); } - + Notifications.add( "Stopping the test due to bad performance. This would cause test calculations to be incorrect. If this happens a lot, please report this.", -1 ); - + TimerEvent.dispatch("fail", "slow timer"); } }