From ec9a68bf098bae22c5af27b5db1de841dc8f7c06 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Tue, 23 May 2023 14:43:46 +0300 Subject: [PATCH] fix: wrong order of ids when sendToFrame is called Signed-off-by: Jari Kolehmainen --- .../send-message-to-channel.injectable.test.ts | 8 ++++---- .../send-message-to-channel.injectable.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.test.ts b/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.test.ts index 5c5a486658..627aea98c2 100644 --- a/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.test.ts +++ b/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.test.ts @@ -84,11 +84,11 @@ describe("send-message-to-channel", () => { it("sends the message to individual frames in webcontents", () => { expect(sendToFrameMock.mock.calls).toEqual([ - ["first", [42, 126], "some-channel", "some-message"], - ["first", [84, 168], "some-channel", "some-message"], + ["first", [126, 42], "some-channel", "some-message"], + ["first", [168, 84], "some-channel", "some-message"], - ["second", [42, 126], "some-channel", "some-message"], - ["second", [84, 168], "some-channel", "some-message"], + ["second", [126, 42], "some-channel", "some-message"], + ["second", [168, 84], "some-channel", "some-message"], ]); }); }); diff --git a/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.ts b/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.ts index e68d8e1577..4fb9d06076 100644 --- a/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.ts +++ b/packages/technical-features/messaging/electron/main/src/send-message-to-channel/send-message-to-channel.injectable.ts @@ -31,7 +31,7 @@ const sendMessageToChannelInjectable = getInjectable({ (channelId: string, ...args: any[]) => webContent.send(channelId, ...args), ...[...frameIds].map(({ frameId, processId }) => (channelId: string, ...args: any[]) => { - webContent.sendToFrame([frameId, processId], channelId, ...args); + webContent.sendToFrame([processId, frameId], channelId, ...args); }), ]),