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 (#21941)
* 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 * refactor: handle import powerMonitor timing issue Fix the previous commit's app-is-ready handler by checking to see if app is already ready when power-monitor.ts is loaded. * refactor: use app.whenReady() for simpler logic * chore: use a consistent comment formatting style Co-authored-by: Charles Kerr <ckerr@github.com>
- Loading branch information