Skip to content

Commit

Permalink
fix timer error message after deferred alarm returns back to normal (#97
Browse files Browse the repository at this point in the history
)
  • Loading branch information
webconn committed Dec 20, 2023
1 parent 57612f4 commit b6fb329
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-rules (2.18.8) stable; urgency=medium

* Fix timer error message after deferred alarm returns back to normal

-- Nikita Maslov <nikita.maslov@wirenboard.ru> Wed, 20 Dec 2023 17:31:38 +0600

wb-rules (2.18.7) stable; urgency=medium

* Bump golang.org/x/sys, no functional changes
Expand Down
10 changes: 8 additions & 2 deletions scripts/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,10 @@ var Alarms = (function () {

if (!wasActive) {
if (alarmSrc.alarmDelayMs > 0)
activateTimerId = setTimeout(activateAlarm, alarmSrc.alarmDelayMs);
activateTimerId = setTimeout(function() {
activateTimerId = null;
activateAlarm();
}, alarmSrc.alarmDelayMs);
else activateAlarm();
}

Expand Down Expand Up @@ -679,7 +682,10 @@ var Alarms = (function () {

if (wasActive) {
if (alarmSrc.noAlarmDelayMs > 0) {
deactivateTimerId = setTimeout(deactivateAlarm, alarmSrc.noAlarmDelayMs);
deactivateTimerId = setTimeout(function() {
deactivateTimerId = null;
deactivateAlarm();
}, alarmSrc.noAlarmDelayMs);
} else deactivateAlarm();
}

Expand Down

0 comments on commit b6fb329

Please sign in to comment.