Skip to content

Commit 16f88fb

Browse files
Copilothovancik
andauthored
Fix duplicate powerMonitor listeners on resume/unlock (#1783)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hovancik <4745859+hovancik@users.noreply.github.com>
1 parent cc75058 commit 16f88fb

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Fixed
9+
- fix crashes on system unlock
810

911
## [1.21.0] - 2026-04-25
1012
### Added

app/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ function onResumeOrUnlock () {
481481
}
482482

483483
function startPowerMonitoring () {
484+
powerMonitor.removeListener('suspend', onSuspendOrLock)
485+
powerMonitor.removeListener('lock-screen', onSuspendOrLock)
486+
powerMonitor.removeListener('resume', onResumeOrUnlock)
487+
powerMonitor.removeListener('unlock-screen', onResumeOrUnlock)
484488
powerMonitor.on('suspend', onSuspendOrLock)
485489
powerMonitor.on('lock-screen', onSuspendOrLock)
486490
powerMonitor.on('resume', onResumeOrUnlock)

0 commit comments

Comments
 (0)