diff --git a/firebase.json b/firebase.json index 0a92ba351..17e046584 100644 --- a/firebase.json +++ b/firebase.json @@ -2,13 +2,6 @@ "hosting": { "public": "public", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], - "redirects": [ - { - "source": "/soon", - "destination": "/", - "type": 301 - } - ], "rewrites": [ { "source": "**", diff --git a/functions/index.js b/functions/index.js index 257eee7c4..483b20459 100644 --- a/functions/index.js +++ b/functions/index.js @@ -262,6 +262,8 @@ function checkIfPB(uid, obj, userdata) { wpm: obj.wpm, acc: obj.acc, raw: obj.rawWpm, + timestamp: Date.now(), + consistency: obj.consistency }, ], }, @@ -285,6 +287,8 @@ function checkIfPB(uid, obj, userdata) { wpm: obj.wpm, acc: obj.acc, raw: obj.rawWpm, + timestamp: Date.now(), + consistency: obj.consistency }, ], }, @@ -316,6 +320,8 @@ function checkIfPB(uid, obj, userdata) { pb.wpm = obj.wpm; pb.acc = obj.acc; pb.raw = obj.rawWpm; + pb.timestamp = Date.now(); + pb.consistency = obj.consistency; toUpdate = true; } else { //no pb @@ -332,6 +338,8 @@ function checkIfPB(uid, obj, userdata) { wpm: obj.wpm, acc: obj.acc, raw: obj.rawWpm, + timestamp: Date.now(), + consistency: obj.consistency }); toUpdate = true; } @@ -346,6 +354,8 @@ function checkIfPB(uid, obj, userdata) { wpm: obj.wpm, acc: obj.acc, raw: obj.rawWpm, + timestamp: Date.now(), + consistency: obj.consistency }, ]; toUpdate = true; @@ -701,9 +711,13 @@ exports.testCompleted = functions return; } request = request.body.data; + if (request === undefined) { + response.status(200).send({ data: { resultCode: -999 } }); + return; + } try { if (request.uid === undefined || request.obj === undefined) { - console.error(`error saving result for ${request.uid} - missing input`); + console.error(`error saving result for - missing input`); response.status(200).send({ data: { resultCode: -999 } }); return; } diff --git a/public/index.html b/public/index.html index 156df26bc..3c97d5877 100644 --- a/public/index.html +++ b/public/index.html @@ -762,13 +762,13 @@
monkey-type