From 211dfc271fccadcc01694198205e1e6c6a8ac93c Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Tue, 17 Oct 2023 13:02:29 -0300 Subject: [PATCH] Send all roomIds at once --- .../ForwardMessageModal/ForwardMessageModal.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/meteor/client/views/room/modals/ForwardMessageModal/ForwardMessageModal.tsx b/apps/meteor/client/views/room/modals/ForwardMessageModal/ForwardMessageModal.tsx index d249d7137728..c70436982b2e 100644 --- a/apps/meteor/client/views/room/modals/ForwardMessageModal/ForwardMessageModal.tsx +++ b/apps/meteor/client/views/room/modals/ForwardMessageModal/ForwardMessageModal.tsx @@ -37,17 +37,12 @@ const ForwardMessageModal = ({ onClose, permalink, message }: ForwardMessageProp mutationFn: async () => { const optionalMessage = ''; const curMsg = await prependReplies(optionalMessage, [message]); + const sendPayload = { + roomId: rooms, + text: curMsg, + }; - return Promise.all( - rooms.map(async (roomId) => { - const sendPayload = { - roomId, - text: curMsg, - }; - - await sendMessage(sendPayload); - }), - ); + return sendMessage(sendPayload); }, onSuccess: () => { dispatchToastMessage({ type: 'success', message: t('Message_has_been_forwarded') });