Skip to content
Snippets Groups Projects
Commit 69e32ad9 authored by Milan Burda's avatar Milan Burda Committed by Alexey Kuzmin
Browse files

refactor: use ipcRenderer.invoke / ipcMain.handle in default-app (#18581)

parent 74825e4d
No related merge requests found
......@@ -37,12 +37,8 @@ function isTrustedSender (webContents: Electron.WebContents) {
return parsedUrl.protocol === 'file:' && urlPath === indexPath
}
ipcMain.on('bootstrap', (event) => {
try {
event.returnValue = isTrustedSender(event.sender) ? electronPath : null
} catch {
event.returnValue = null
}
ipcMain.handle('bootstrap', (event) => {
return isTrustedSender(event.sender) ? electronPath : null
})
async function createWindow () {
......
import { ipcRenderer } from 'electron'
function initialize () {
const electronPath = ipcRenderer.sendSync('bootstrap')
async function initialize () {
const electronPath = await ipcRenderer.invoke('bootstrap')
function replaceText (selector: string, text: string) {
const element = document.querySelector<HTMLElement>(selector)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment