From 76ab92292acbce357b8d30daada29c2971c04f01 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 15 May 2020 02:58:32 +0100 Subject: [PATCH] removed console.log added an event for starting the test --- public/js/script.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index d94ed7c23..4bec977c7 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -421,7 +421,7 @@ function showResult() { if (stats.wpm > 0 && stats.wpm < 250 && stats.acc > 50 && stats.acc <= 100) { if (firebase.auth().currentUser != null) { db_getUserHighestWpm(config.mode, mode2).then(data => { - console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`); + // console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`); if (data < stats.wpm) { showCrown(); } @@ -621,9 +621,9 @@ function changePage(page) { $('.config').css('opacity', 0); } } - firebase.analytics().logEvent('changedPage', { - page: page - }); + // firebase.analytics().logEvent('changedPage', { + // page: page + // }); } function changeMode(mode) { @@ -821,6 +821,11 @@ $(document).keypress(function(event) { if (event["keyCode"] == 32) return; //start the test if (currentInput == "" && inputHistory.length == 0) { + if (firebase.auth().currentUser != null) { + firebase.analytics().logEvent('testStarted'); + } else { + firebase.analytics().logEvent('testStartedNoLogin'); + } testActive = true; stopCaretAnimation(); testStart = Date.now(); @@ -828,7 +833,6 @@ $(document).keypress(function(event) { showTimer(); } updateTimerBar(); - //TODO: #1 Sometimes the timer counts up at double speed for some reason clearIntervals(); timers.push(setInterval(function() { time++;