Skip to content

Commit

Permalink
Restore whenReady, as I do not see the freeze (#9262)
Browse files Browse the repository at this point in the history
When cleaning up board, I stumbled upon #5851 I tried to replace whenReady, and it just worked. Perhaps the freeze was fixed during some electron version bump.

Tests on other platforms (I'm using Garuda Linux) advised.

Fixes #5851
  • Loading branch information
farmaazon authored and somebody1234 committed Mar 6, 2024
1 parent 9101626 commit c1ad57b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions app/ide-desktop/lib/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ class App {
this.setChromeOptions(chromeOptions)
security.enableAll()
electron.app.on('before-quit', () => (this.isQuitting = true))
/** TODO [NP]: https://github.com/enso-org/enso/issues/5851
* The `electron.app.whenReady()` listener is preferable to the
* `electron.app.on('ready', ...)` listener. When the former is used in combination with
* the `authentication.initModule` call that is called in the listener, the application
* freezes. This freeze should be diagnosed and fixed. Then, the `whenReady()` listener
* should be used here instead. */
electron.app.on('ready', () => {
logger.log('Electron application is ready.')
void this.main(windowSize)
})
electron.app.whenReady().then(
() => {
logger.log('Electron application is ready.')
void this.main(windowSize)
},
err => {
logger.error('Failed to initialize electron.', err)
}
)
this.registerShortcuts()
}
}
Expand Down

0 comments on commit c1ad57b

Please sign in to comment.