Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use powerMonitor.on() only after app is ready #21942

Conversation

trop[bot]
Copy link
Contributor

@trop trop bot commented Jan 28, 2020

Backport of #21927

See that PR for details.

Notes: Fixed error thrown when importing powerMonitor on Linux before app's 'ready' event.

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
Fix the previous commit's app-is-ready handler by checking to see if
app is already ready when power-monitor.ts is loaded.
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 28, 2020
@trop trop bot requested a review from ckerr January 28, 2020 18:20
@trop trop bot added 8-x-y backport This is a backport PR labels Jan 28, 2020
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 28, 2020
@codebytere codebytere merged commit 83c4633 into 8-x-y Jan 28, 2020
@release-clerk
Copy link

release-clerk bot commented Jan 28, 2020

Release Notes Persisted

Fixed error thrown when importing powerMonitor on Linux before app's 'ready' event.

@codebytere codebytere deleted the trop/8-x-y-bp-fix-use-powermonitor-on-only-after-app-is-ready-1580235600376 branch January 28, 2020 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8-x-y backport This is a backport PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants