Skip to content

Node.js based forum software built for the modern web

fix reward claimable check

Barış Soner Uşaklı5c51a91e8569
diff --git a/src/rewards/index.js b/src/rewards/index.js
index 2d201e33f3..0fc1b0edf3 100644
--- a/src/rewards/index.js
+++ b/src/rewards/index.js
@@ -74,8 +74,7 @@ function filterCompletedRewards(uid, rewards, callback) {
}
var claimable = parseInt(reward.claimable, 10);
-
- return claimable === 0 || (userRewards[reward.id] < reward.claimable);
+ return claimable === 0 || (!userRewards[reward.id] || userRewards[reward.id] < reward.claimable);
});
next(null, rewards);
diff --git a/src/topics/popular.js b/src/topics/popular.js
index ee77ef7544..b85e66d213 100644
--- a/src/topics/popular.js
+++ b/src/topics/popular.js
@@ -15,7 +15,7 @@ module.exports = function (Topics) {
},
function (topics, next) {
sortTiedTopicsByViews(topics, next);
- }
+ },
], callback);
return;
}