From 3b0c42a591dfbb120e5398697f5e0992e2b2147c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 13 Dec 2021 14:18:37 -0500 Subject: [PATCH] fix: prettier bulk method usage --- src/messaging/rooms.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js index 4ad1c17d3c..51cfd793db 100644 --- a/src/messaging/rooms.js +++ b/src/messaging/rooms.js @@ -117,9 +117,9 @@ module.exports = function (Messaging) { const userCounts = await db.sortedSetsCard(roomIds.map(roomId => `chat:room:${roomId}:uids`)); const groupChats = roomIds.filter((roomId, index) => userCounts[index] > 2); const privateChats = roomIds.filter((roomId, index) => userCounts[index] <= 2); - await Promise.all([ - db.setObjectBulk(groupChats.map(id => [`chat:room:${id}`, { groupChat: 1 }])), - db.setObjectBulk(privateChats.map(id => [`chat:room:${id}`, { groupChat: 0 }])), + await db.setObjectBulk([ + ...groupChats.map(id => [`chat:room:${id}`, { groupChat: 1 }]), + ...privateChats.map(id => [`chat:room:${id}`, { groupChat: 0 }]), ]); }