From 91f0d98d63ad342cf81b2f23b9ce206ca2931b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Tue, 30 Aug 2016 14:56:46 +0200 Subject: [PATCH] Fix wrong colors being in current colors --- src/js/service/CurrentColorsService.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/service/CurrentColorsService.js b/src/js/service/CurrentColorsService.js index b6acadb8..bff8f69a 100644 --- a/src/js/service/CurrentColorsService.js +++ b/src/js/service/CurrentColorsService.js @@ -111,7 +111,7 @@ if (lastColors) { Object.keys(lastColors).forEach(function(color) { - if (!colors[color]) { + if (!frameCache[hash][color]) { delete colors[color]; } }); @@ -122,8 +122,7 @@ } } - var batchAllThen = function (results) { - var colors = {}; + var batchAllThen = function (colors, results) { results.forEach(function (result) { Object.keys(result).forEach(function (color) { colors[color] = true; @@ -139,7 +138,7 @@ } this.setCurrentColors(hexColors); - }.bind(this) + }.bind(this, colors); if (framesToBatch.length == 0) { batchAllThen([colors]);