Fix wrong colors being in current colors

This commit is contained in:
Dávid Szabó 2016-08-30 14:56:46 +02:00 committed by Julian Descottes
parent fa716d7a6c
commit 91f0d98d63

View File

@ -111,7 +111,7 @@
if (lastColors) { if (lastColors) {
Object.keys(lastColors).forEach(function(color) { Object.keys(lastColors).forEach(function(color) {
if (!colors[color]) { if (!frameCache[hash][color]) {
delete colors[color]; delete colors[color];
} }
}); });
@ -122,8 +122,7 @@
} }
} }
var batchAllThen = function (results) { var batchAllThen = function (colors, results) {
var colors = {};
results.forEach(function (result) { results.forEach(function (result) {
Object.keys(result).forEach(function (color) { Object.keys(result).forEach(function (color) {
colors[color] = true; colors[color] = true;
@ -139,7 +138,7 @@
} }
this.setCurrentColors(hexColors); this.setCurrentColors(hexColors);
}.bind(this) }.bind(this, colors);
if (framesToBatch.length == 0) { if (framesToBatch.length == 0) {
batchAllThen([colors]); batchAllThen([colors]);