diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index f554f50a8..42957c7ac 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -614,6 +614,13 @@ let commandsPaceCaret = { UpdateConfig.setPaceCaret("average"); }, }, + { + id: "setPaceCaretRepeat", + display: "repeat", + exec: () => { + UpdateConfig.setPaceCaret("repeat"); + }, + }, { id: "setPaceCaretCustom", display: "custom...", diff --git a/src/js/test/pace-caret.js b/src/js/test/pace-caret.js index 00af76c62..43b42a03f 100644 --- a/src/js/test/pace-caret.js +++ b/src/js/test/pace-caret.js @@ -6,7 +6,11 @@ import * as DB from "./db"; export let settings = null; function resetCaretPosition() { - if (Config.paceCaret === "off" && !TestLogic.isPaceRepeat) return; + if ( + Config.paceCaret !== "off" && + (Config.paceCaret !== "repeat" || TestLogic.isPaceRepeat) + ) + return; if (!$("#paceCaret").hasClass("hidden")) { $("#paceCaret").addClass("hidden"); } @@ -69,7 +73,7 @@ export async function init() { console.log("avg pace " + wpm); } else if (Config.paceCaret === "custom") { wpm = Config.paceCaretCustomSpeed; - } else if (TestLogic.isPaceRepeat == true) { + } else if (Config.paceCaret === "repeat" && Repeat) { wpm = TestLogic.lastTestWpm; } if (wpm < 1 || wpm == false || wpm == undefined || Number.isNaN(wpm)) { diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 8acb1f073..f8ff75c34 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -342,7 +342,11 @@ export function startTest() { } try { - if (Config.paceCaret !== "off" || isPaceRepeat) PaceCaret.start(); + if ( + Config.paceCaret !== "off" && + (Config.paceCaret !== "repeat" || isPaceRepeat) + ) + PaceCaret.start(); } catch (e) {} //use a recursive self-adjusting timer to avoid time drift TestStats.setStart(performance.now()); diff --git a/src/js/test/test-ui.js b/src/js/test/test-ui.js index ff32aa26e..905a56e18 100644 --- a/src/js/test/test-ui.js +++ b/src/js/test/test-ui.js @@ -195,8 +195,8 @@ export function screenshot() { if (firebase.auth().currentUser == null) $(".pageTest .loginTip").removeClass("hidden"); } - - if (!$("#resultReplay").hasClass('hidden')) { + + if (!$("#resultReplay").hasClass("hidden")) { revealReplay = true; Replay.pauseReplay(); } @@ -491,7 +491,10 @@ export function updateModesNotice() { ); } - if (Config.paceCaret !== "off" || TestLogic.isPaceRepeat) { + if ( + Config.paceCaret !== "off" && + (Config.paceCaret !== "repeat" || TestLogic.isPaceRepeat) + ) { let speed = ""; try { speed = ` (${Math.round(PaceCaret.settings.wpm)} wpm)`; @@ -502,7 +505,7 @@ export function updateModesNotice() { ? "average" : Config.paceCaret === "pb" ? "pb" - : Config.paceCaret == "off" + : Config.paceCaret == "repeat" ? "repeated" : "custom" } pace${speed}` diff --git a/static/index.html b/static/index.html index 62a940dfb..a345ea6a4 100644 --- a/static/index.html +++ b/static/index.html @@ -2648,7 +2648,9 @@

pace caret

- Displays a second caret that moves at constant speed. + Displays a second caret that moves at constant speed. The + repeat option enables a pace caret when a test is repeated + that will have the wpm of the previous test.
pb
+
+ repeat +
+
+ off +
or
- Sign in with Google + Google Sign In