Skip to content

Node.js based forum software built for the modern web

refactor: use arrow func

Baris Usakli27c27b497e93
diff --git a/src/messaging/notifications.js b/src/messaging/notifications.js
index 28f76fbc62..6886b2c08a 100644
--- a/src/messaging/notifications.js
+++ b/src/messaging/notifications.js
@@ -69,8 +69,6 @@ module.exports = function (Messaging) {
});
delete Messaging.notifyQueue[fromuid + ':' + roomId];
- if (notification) {
- notifications.push(notification, uids);
- }
+ notifications.push(notification, uids);
}
};
diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js
index ed5ae4ec6b..e7e1546841 100644
--- a/src/messaging/rooms.js
+++ b/src/messaging/rooms.js
@@ -114,12 +114,8 @@ module.exports = function (Messaging) {
Messaging.leaveRoom = async (uids, roomId) => {
const keys = uids
- .map(function (uid) {
- return 'uid:' + uid + ':chat:rooms';
- })
- .concat(uids.map(function (uid) {
- return 'uid:' + uid + ':chat:rooms:unread';
- }));
+ .map(uid => 'uid:' + uid + ':chat:rooms')
+ .concat(uids.map(uid => 'uid:' + uid + ':chat:rooms:unread'));
await Promise.all([
db.sortedSetRemove('chat:room:' + roomId + ':uids', uids),