1
0
Fork 0

fixed activepedom widget, only exit after lastupdate has been recorded

master
hughbarney 2021-02-02 21:19:11 +00:00
parent 6e14194541
commit 75fe5ced02
1 changed files with 6 additions and 3 deletions

View File

@ -141,9 +141,6 @@
function draw() { function draw() {
var height = 23; //width is deined globally var height = 23; //width is deined globally
// not everyone likes a widget
if (setting('lineOne') == 'Hide' && setting('lineTwo') == 'Hide')
return;
distance = (stepsCounted * setting('stepLength')) / 100 /1000; //distance in km distance = (stepsCounted * setting('stepLength')) / 100 /1000; //distance in km
@ -158,6 +155,12 @@
stepsOutsideTime = 0; stepsOutsideTime = 0;
} }
lastUpdate = date; lastUpdate = date;
// not everyone likes a widget, having refreshed lastUpdate we can exit
if (setting('lineOne') == 'Hide' && setting('lineTwo') == 'Hide') {
settings = 0; //reset settings to save memory
return;
}
g.reset(); g.reset();
g.clearRect(this.x, this.y, this.x+width, this.y+height); g.clearRect(this.x, this.y, this.x+width, this.y+height);