From 2c7696387a1e695fc4212f7679d935a25819d845 Mon Sep 17 00:00:00 2001 From: Richard de Boer Date: Wed, 1 Apr 2020 14:59:06 +0200 Subject: [PATCH] Bar clock: fix SyntaxError Seems the app still works though (Snuck in during code cleanup, I'm blaming autoformat) --- apps.json | 2 +- apps/barclock/ChangeLog | 1 + apps/barclock/clock-bar.js | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps.json b/apps.json index d6daa2f5cf..0931d8a987 100644 --- a/apps.json +++ b/apps.json @@ -919,7 +919,7 @@ { "id": "barclock", "name": "Bar Clock", "icon": "clock-bar.png", - "version":"0.03", + "version":"0.04", "description": "A simple digital clock showing seconds as a bar", "tags": "clock", "type":"clock", diff --git a/apps/barclock/ChangeLog b/apps/barclock/ChangeLog index 89f5a1d583..2e0fd088cb 100644 --- a/apps/barclock/ChangeLog +++ b/apps/barclock/ChangeLog @@ -1,3 +1,4 @@ 0.01: Created Bar Clock 0.02: Apply locale, 12-hour setting 0.03: Fix dates drawing over each other at midnight +0.04: Small bugfix diff --git a/apps/barclock/clock-bar.js b/apps/barclock/clock-bar.js index f106f8125a..da436daeef 100644 --- a/apps/barclock/clock-bar.js +++ b/apps/barclock/clock-bar.js @@ -103,7 +103,10 @@ const drawBar = function (date) { const b = settings.bar const seconds = date.getSeconds() - if (seconds === 0) return // zero-size rect stills draws one line of pixels + if (seconds === 0) { + // zero-size rect stills draws one line of pixels, we don't want that + return + } const fraction = seconds / SECONDS_PER_MINUTE, width = fraction * screen.width g.setColor(b.color)