You need to add await
to wait for the result of executing window.Shiny.shinyapp.isConnected()
.
...
await mainWindow.webContents.executeJavaScript('window.Shiny.shinyapp.isConnected()', true)
.then((result) => {
shinyRunning = true
mainWindow.show()
loadingSplashScreen.hide()
loadingSplashScreen.close()
console.log(new Date().toISOString() + ': Successfully connected to the app')
})
...
CLICK HERE to find out more related problems solutions.