@@ -43,7 +43,7 @@ Module.register("MMM-Screen-Powersave-Notification", {
43
43
hours = Math . round ( ( seconds - remainingSeconds ) / 3600 ) ;
44
44
}
45
45
46
- remainingSeconds2 = remainingSeconds % 60 ;
46
+ let remainingSeconds2 = remainingSeconds % 60 ;
47
47
var minutes = Math . round ( ( remainingSeconds - remainingSeconds2 ) / 60 ) ;
48
48
49
49
if ( this . config . displayHours ) {
@@ -63,6 +63,13 @@ Module.register("MMM-Screen-Powersave-Notification", {
63
63
}
64
64
} ,
65
65
66
+ conditionalUpdateDom : function ( animationSpeed ) {
67
+ const self = this
68
+ if ( typeof self . data . position !== "undefined" ) {
69
+ self . updateDom ( animationSpeed )
70
+ }
71
+ } ,
72
+
66
73
getDom : function ( ) {
67
74
const wrapper = document . createElement ( "div" ) ;
68
75
if ( typeof this . data . position !== "undefined" ) {
@@ -90,8 +97,8 @@ Module.register("MMM-Screen-Powersave-Notification", {
90
97
const self = this ;
91
98
self . currentDelayTimer = setTimeout ( function ( ) {
92
99
self . currentDelay =
93
- self . currentDelay - self . config . countDownUpdateInterval / 1000 ;
94
- self . updateDom ( self . config . animationSpeed ) ;
100
+ self . currentDelay - self . config . countDownUpdateInterval / 1000 ;
101
+ self . conditionalUpdateDom ( self . config . animationSpeed ) ;
95
102
} , self . config . countDownUpdateInterval ) ;
96
103
}
97
104
}
@@ -181,7 +188,7 @@ Module.register("MMM-Screen-Powersave-Notification", {
181
188
} else {
182
189
this . delayDisabled = false ;
183
190
}
184
- this . updateDom ( ) ;
191
+ self . conditionalUpdateDom ( self . config . animationSpeed )
185
192
} else if ( notification === "SCREEN_HIDE_MODULES" ) {
186
193
self . sendNotification ( "DISABLE_PROFILE_TIMERS" ) ;
187
194
if ( self . config . changeToProfile !== null ) {
0 commit comments