aboutsummaryrefslogtreecommitdiff
path: root/build/database.js
diff options
context:
space:
mode:
Diffstat (limited to 'build/database.js')
-rw-r--r--build/database.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/build/database.js b/build/database.js
index 8543901..a12fc9e 100644
--- a/build/database.js
+++ b/build/database.js
@@ -403,14 +403,16 @@ async function getApplicableMemberLeaderboardAttributes(member) {
// add the "leaderboards count" attribute
const leaderboardsCount = Object.keys(applicableAttributes).length;
const leaderboardsCountRequirement = await getLeaderboardRequirement('leaderboards_count', 'member');
- if ((leaderboardsCountRequirement.top_100 === null)
- || (leaderboardsCount > leaderboardsCountRequirement.top_100))
+ if (leaderboardsCount > 0
+ && ((leaderboardsCountRequirement.top_100 === null)
+ || (leaderboardsCount > leaderboardsCountRequirement.top_100)))
applicableAttributes['leaderboards_count'] = leaderboardsCount;
// add the "first leaderboards count" attribute
const top1LeaderboardsCount = Object.keys(applicableTop1Attributes).length;
const top1LeaderboardsCountRequirement = await getLeaderboardRequirement('top_1_leaderboards_count', 'member');
- if ((top1LeaderboardsCountRequirement.top_100 === null)
- || (top1LeaderboardsCount > top1LeaderboardsCountRequirement.top_100))
+ if (top1LeaderboardsCount > 0
+ && ((top1LeaderboardsCountRequirement.top_100 === null)
+ || (top1LeaderboardsCount > top1LeaderboardsCountRequirement.top_100)))
applicableAttributes['top_1_leaderboards_count'] = top1LeaderboardsCount;
return applicableAttributes;
}