Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use powerMonitor.on() only after app is ready
powerMonitor can't be used until the app is ready; however, on Linux, powerMonitor.on() was called as soon as lib/browser/api/power-monitor.ts was loaded. This patch takes @vladimiry's suggestion of wrapping that in an app.on('ready') handler to prevent powerMonitor.on() from being called prematurely. Fixes #21716
- Loading branch information
Showing
1 changed file
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Will the
ready
event be replayed if it got fired already before this code starts? I meanpower-monitor
module could be loaded lazily afterready
got fired already and the guess isready
event won't be replayed in this case. This is why I was thinking about using/introducing something likeapp.promises.ready
(the promise gets resolved byapp
module in along with firing theready
event).