Skip to content

Commit

Permalink
Send all roomIds at once
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed Oct 18, 2023
1 parent 4a9f0d7 commit 211dfc2
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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') });
Expand Down

0 comments on commit 211dfc2

Please sign in to comment.