diff --git a/src/common/ipc.ts b/src/common/ipc.ts index 0b4e2c97d2..8368cdde6b 100644 --- a/src/common/ipc.ts +++ b/src/common/ipc.ts @@ -26,13 +26,9 @@ export async function broadcastMessage(channel: string, ...args: any[]) { if (!views) return; - let subFrames: Promise; - - if (ipcRenderer) { - subFrames = requestMain(subFramesChannel); - } else { - subFrames = getSubFrames(); - } + const subFrames: Promise = ipcRenderer + ? requestMain(subFramesChannel) + : getSubFrames(); views.forEach(async webContent => { const type = webContent.getType();