mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
use includes instead of indexOf
use _.uniq instead of filter&indexOf
This commit is contained in:
@@ -199,7 +199,7 @@ SocketHelpers.upvote = function (data, notification) {
|
||||
return votes > 0 && votes % 10 === 0;
|
||||
},
|
||||
threshold: function () {
|
||||
return [1, 5, 10, 25].indexOf(votes) !== -1 || (votes >= 50 && votes % 50 === 0);
|
||||
return [1, 5, 10, 25].includes(votes) || (votes >= 50 && votes % 50 === 0);
|
||||
},
|
||||
logarithmic: function () {
|
||||
return votes > 1 && Math.log10(votes) % 1 === 0;
|
||||
|
||||
Reference in New Issue
Block a user