From 0ac4754c11954262c6dd15fcec77b795256b9e24 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 18 Mar 2021 02:31:03 +0000 Subject: [PATCH] fixed leaderboards not working when full --- functions/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/index.js b/functions/index.js index 1f5c10aa9..842c9872e 100644 --- a/functions/index.js +++ b/functions/index.js @@ -2389,7 +2389,7 @@ exports.checkLeaderboards = functions.https.onRequest( boardInfo.minWpm === undefined || boardInfo.board.length !== boardInfo.size || (boardInfo.minWpm !== undefined && - request.wpm > boardInfo.minWpm && + request.result.wpm > boardInfo.minWpm && boardInfo.board.length === boardInfo.size) ) { let boardData = boardInfo.board; @@ -2413,7 +2413,7 @@ exports.checkLeaderboards = functions.https.onRequest( } else { //not above leaderboard minwpm return { - insertedAt: -999, + insertedAt: -1, }; } }) @@ -2467,7 +2467,7 @@ exports.checkLeaderboards = functions.https.onRequest( boardInfo.minWpm === undefined || boardInfo.board.length !== boardInfo.size || (boardInfo.minWpm !== undefined && - request.wpm > boardInfo.minWpm && + request.result.wpm > boardInfo.minWpm && boardInfo.board.length === boardInfo.size) ) { let boardData = boardInfo.board; @@ -2491,7 +2491,7 @@ exports.checkLeaderboards = functions.https.onRequest( } else { //not above leaderboard minwpm return { - insertedAt: -999, + insertedAt: -1, }; } })