When I used orca.run, the call back wasn't called. After checking the orca codes, I found the problem: electron app had been called 'ready' before orca.run, so orca.run call back is invalid.
Those modified codes in index.js createApp work for me:
function createApp (_opts) {
initApp(app, ipcMain)
const opts = coerceOpts(_opts)
let win = null
let index = null
let readyCallback = () => {
win = new BrowserWindow(opts._browserWindowOpts)
if (opts.debug) {
win.openDevTools()
}
win.on('closed', () => {
win = null
index.destroy()
})
createIndex(opts.component, opts, (_index) => {
index = _index
win.loadURL(`file://${index.path}`)
})
win.webContents.once('did-finish-load', () => {
run(app, win, ipcMain, opts)
})
}
if (app.isReady()) {
readyCallback();
} else {
app.on('ready', readyCallback);
}
return app
}
When I used
orca.run
, the call back wasn't called. After checking the orca codes, I found the problem: electron app had been called 'ready' beforeorca.run
, so orca.run call back is invalid.Those modified codes in index.js
createApp
work for me: