From e5816742c184207240fc2403c31eb4b21da31532 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 9 Jul 2020 17:01:40 +0100 Subject: [PATCH] dont add to lb if cant verify keys --- functions/index.js | 2 ++ public/index.html | 22 +++++++++++----------- public/js/script.js | 10 +++++++++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/functions/index.js b/functions/index.js index 9c1345bcc..2d4dfc779 100644 --- a/functions/index.js +++ b/functions/index.js @@ -449,6 +449,8 @@ exports.testCompleted = functions.https.onCall((request, response) => { ); return { resultCode: -2 }; } + } else { + return { resultCode: -3 }; } } diff --git a/public/index.html b/public/index.html index 60fd2b858..063222a26 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ Monkey Type - + @@ -1280,17 +1280,17 @@ - + - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/public/js/script.js b/public/js/script.js index 9fe1f10de..77a05a854 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1106,8 +1106,16 @@ function showResult(difficultyFailed = false) { "Possible bot detected. Result not saved.", 4000 ); + } else if (e.data.resultCode === -3) { + showNotification( + "Could not verify. Result not saved. Refresh or contact Miodec on Discord.", + 4000 + ); } else if (e.data.resultCode === -999) { - showNotification("Internal error. Result not saved.", 4000); + showNotification( + "Internal error. Result not saved. Refresh or contact Miodec on Discord.", + 6000 + ); } else if (e.data.resultCode === 1 || e.data.resultCode === 2) { dbSnapshot.results.unshift(completedEvent); try {