ClockFace: fix fast loading

master
Richard de Boer 2022-12-11 15:15:44 +01:00
parent 640fe08d9e
commit 825a705339
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,7 @@ function ClockFace(options) {
ClockFace.prototype.tick = function() {
"ram"
if (this._removed) return;
const time = new Date();
const now = {
d: `${time.getFullYear()}-${time.getMonth()}-${time.getDate()}`,
@ -131,6 +132,7 @@ ClockFace.prototype.resume = function() {
this.tick();
};
ClockFace.prototype.remove = function() {
this._removed = true;
if (this._timeout) clearTimeout(this._timeout);
Bangle.removeListener("lcdPower", this._onLcd);
if (this._remove) this._remove.apply(this);