From 805796e4e0d292cddb4016caf17094a5773dc97f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 14 Nov 2017 15:27:28 +0000 Subject: [PATCH] force the tinter to refresh when we change theme --- src/Tinter.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Tinter.js b/src/Tinter.js index be894f003b..1b2416762f 100644 --- a/src/Tinter.js +++ b/src/Tinter.js @@ -101,6 +101,9 @@ class Tinter { // the currently loaded theme (if any) this.theme = undefined; + + // whether to force a tint (e.g. after changing theme) + this.forceTint = false; } /** @@ -153,12 +156,15 @@ class Tinter { tertiaryColor = rgbToHex(rgb1); } - if (this.colors[0] === primaryColor && + if (this.forceTint == false && + this.colors[0] === primaryColor && this.colors[1] === secondaryColor && this.colors[2] === tertiaryColor) { return; } + this.forceTint = false; + this.colors[0] = primaryColor; this.colors[1] = secondaryColor; this.colors[2] = tertiaryColor; @@ -204,6 +210,7 @@ class Tinter { } this.calcCssFixups(); + this.forceTint = true; } calcCssFixups() {