From 63e4faf73d06b3510afd4fee5cac9545d70abd67 Mon Sep 17 00:00:00 2001 From: lukas Date: Sun, 26 Sep 2021 23:58:56 +0200 Subject: [PATCH] avoid triggering forceupdate on homepage on init of theme state --- src/utils/GlobalInfos.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/utils/GlobalInfos.ts b/src/utils/GlobalInfos.ts index 70f7495..a339991 100644 --- a/src/utils/GlobalInfos.ts +++ b/src/utils/GlobalInfos.ts @@ -25,12 +25,14 @@ class StaticInfos { * @param enable enable the dark theme? */ enableDarkTheme(enable = true): void { - this.darktheme = enable; + if (this.darktheme !== enable) { + this.darktheme = enable; - // trigger onThemeChange handlers - this.handlers.map((func) => { - func(); - }); + // trigger onThemeChange handlers + this.handlers.map((func) => { + func(); + }); + } } /**