mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
93bc8fcb86
commit
a731e66b18
1 file changed
+4
-2
+4
-2
@@ -10,7 +10,7 @@ export function handleRequest(channel: string, listener: (...args: any[]) => any
|
||||
}
|
||||
|
||||
export async function requestMain(channel: string, ...args: any[]) {
|
||||
return await ipcRenderer.invoke(channel, ...args)
|
||||
return ipcRenderer.invoke(channel, ...args)
|
||||
}
|
||||
|
||||
async function getSubFrames(): Promise<number[]> {
|
||||
@@ -25,7 +25,9 @@ async function getSubFrames(): Promise<number[]> {
|
||||
}
|
||||
|
||||
export function broadcastMessage(channel: string, ...args: any[]) {
|
||||
const views = (webContents || remote.webContents).getAllWebContents();
|
||||
const views = (webContents || remote?.webContents)?.getAllWebContents();
|
||||
if (!views) return
|
||||
|
||||
views.forEach(webContent => {
|
||||
const type = webContent.getType();
|
||||
logger.silly(`[IPC]: broadcasting "${channel}" to ${type}=${webContent.id}`, { args });
|
||||
|
||||
Reference in new issue
Block a user