From 772381dc195f21aad2034dbdec764abbc8b3cf4c Mon Sep 17 00:00:00 2001 From: William Toohey Date: Thu, 11 Feb 2016 20:50:25 +1000 Subject: [PATCH] Don't restart blackout when already in one. Fixes #11 --- src/js/HuesCanvas.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/HuesCanvas.js b/src/js/HuesCanvas.js index b5a9a28..1e7a67d 100644 --- a/src/js/HuesCanvas.js +++ b/src/js/HuesCanvas.js @@ -386,7 +386,10 @@ HuesCanvas.prototype.doBlackout = function(whiteout) { this.blackoutColour = "#000"; } this.blackoutTimeout = 0; // indefinite - this.blackoutStart = this.audio.currentTime; + // Don't restart the blackout animation if we're already blacked out + if(!this.blackout) { + this.blackoutStart = this.audio.currentTime; + } this.blackout = true; this.needsRedraw = true; if(localStorage["blackoutUI"] == "on") {