I have an app that’s heavily focused on awards and I have a leaderboard screen that I need to update so I can hide from view the users with zero points and only display users that have at least one point in their score, can this be done?
Is there a JS code snippet someone can share with me?
Hi Carina, on the page Leaderboard we have 2 LFD witch are loading the same data.
We need a way to separate those two LFDs, so:
1. At the top of the page add:
var firstLoad = true;
2. At the end of flListDataAfterGetData hook, add:
_.remove(options.records, function(el) {
return el.data[firstLoad ? 'contributorScore' : 'commentScore'] == 0;
});
firstLoad = !firstLoad;
Based on the error I assumed I pasted the code in the wrong place, I managed to update this in a way that removed the popup error “Options is not defined”, but the code still isn’t working as all the users are still there despite having zero points.
Thanks, this hid the number 0 from the score on the list view of the directory LFD on my screen but the users are still shown on the LFD, I want to hide the users not just the score, is this possible?
I pasted the code inside the sort condition as you’ve mentioned ` options.records = options.records.sort(function (b, a) {
options.records = options.records.sort(function(b, a) {
return a.data.achievementsLength - b.data.achievementsLength;
});