mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix missing event on ipcMain.emit
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
5c8139b025
commit
b0f4691778
@ -31,20 +31,23 @@ function getSubFrames(): ClusterFrameInfo[] {
|
|||||||
|
|
||||||
export async function broadcastMessage(channel: string, ...args: any[]): Promise<void> {
|
export async function broadcastMessage(channel: string, ...args: any[]): Promise<void> {
|
||||||
if (ipcRenderer) {
|
if (ipcRenderer) {
|
||||||
return requestMain(broadcastMainChannel, ...args);
|
return requestMain(broadcastMainChannel, channel, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!webContents) {
|
if (!ipcMain) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipcMain.listeners(channel).forEach((func) => func({
|
||||||
|
processId: undefined, frameId: undefined, sender: undefined, senderFrame: undefined,
|
||||||
|
}, ...args));
|
||||||
|
|
||||||
const subFrames = getSubFrames();
|
const subFrames = getSubFrames();
|
||||||
const views = webContents.getAllWebContents();
|
const views = webContents.getAllWebContents();
|
||||||
|
|
||||||
if (!views || !Array.isArray(views) || views.length === 0) return;
|
if (!views || !Array.isArray(views) || views.length === 0) return;
|
||||||
args = args.map(sanitizePayload);
|
|
||||||
|
|
||||||
ipcMain?.emit(channel, ...args);
|
args = args.map(sanitizePayload);
|
||||||
|
|
||||||
for (const view of views) {
|
for (const view of views) {
|
||||||
let viewType = "unknown";
|
let viewType = "unknown";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user