mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
use includes instead of indexOf
use _.uniq instead of filter&indexOf
This commit is contained in:
@@ -101,7 +101,7 @@ SocketTopics.changeWatching = function (socket, data, callback) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
var commands = ['follow', 'unfollow', 'ignore'];
|
||||
if (commands.indexOf(data.type) === -1) {
|
||||
if (!commands.includes(data.type)) {
|
||||
return callback(new Error('[[error:invalid-command]]'));
|
||||
}
|
||||
followCommand(topics[data.type], socket, data.tid, callback);
|
||||
|
||||
Reference in New Issue
Block a user