From 2a4750eb718669959f998a6fc5342d33a23efde8 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Mon, 24 Feb 2020 16:48:05 +0100 Subject: [PATCH] Don't guess new variants if this is the same theme --- src/modules/Switcher.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/Switcher.js b/src/modules/Switcher.js index 2afd04b..adc972f 100644 --- a/src/modules/Switcher.js +++ b/src/modules/Switcher.js @@ -82,7 +82,10 @@ var Switcher = class { } _on_theme_change() { - this.variants = Variants.guess_from(this.theme.current); + const new_theme = this.theme.current; + if ( new_theme !== this.variants.day && new_theme !== this.variants.night ) { + this.variants = Variants.guess_from(new_theme); + } this._apply_theme_variant(); }