the loop inside the async function executes one additional time when the condition is false

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.

Leave a Comment

Your email address will not be published.

Scroll to Top