refactor: use arrow func

This commit is contained in:
Baris Usakli
2019-08-19 11:07:59 -04:00
parent 2b1f840eb1
commit 27c27b497e
2 changed files with 3 additions and 9 deletions

View File

@@ -69,8 +69,6 @@ module.exports = function (Messaging) {
}); });
delete Messaging.notifyQueue[fromuid + ':' + roomId]; delete Messaging.notifyQueue[fromuid + ':' + roomId];
if (notification) { notifications.push(notification, uids);
notifications.push(notification, uids);
}
} }
}; };

View File

@@ -114,12 +114,8 @@ module.exports = function (Messaging) {
Messaging.leaveRoom = async (uids, roomId) => { Messaging.leaveRoom = async (uids, roomId) => {
const keys = uids const keys = uids
.map(function (uid) { .map(uid => 'uid:' + uid + ':chat:rooms')
return 'uid:' + uid + ':chat:rooms'; .concat(uids.map(uid => 'uid:' + uid + ':chat:rooms:unread'));
})
.concat(uids.map(function (uid) {
return 'uid:' + uid + ':chat:rooms:unread';
}));
await Promise.all([ await Promise.all([
db.sortedSetRemove('chat:room:' + roomId + ':uids', uids), db.sortedSetRemove('chat:room:' + roomId + ':uids', uids),