From 1e9149d8720a4bf59e8aeaddd4cb0329f377ba8a Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Wed, 4 Oct 2023 17:44:54 +0530 Subject: [PATCH] fix: themening validation in store init. (#2350) --- web/lib/mobx/store-init.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/lib/mobx/store-init.tsx b/web/lib/mobx/store-init.tsx index 5c2ee0558..771d8eaba 100644 --- a/web/lib/mobx/store-init.tsx +++ b/web/lib/mobx/store-init.tsx @@ -24,9 +24,12 @@ const MobxStoreInit = () => { ); // theme - if (store.theme.theme === null && store?.user?.currentUserSettings) { + if ( + (store.theme.theme === null || store.theme.theme === "undefined") && + store?.user?.currentUserSettings + ) { let currentTheme = localStorage.getItem("theme"); - currentTheme = currentTheme ? currentTheme : "system"; + currentTheme = currentTheme && currentTheme != "undefined" ? currentTheme : "system"; // validating the theme and applying for initial state if (currentTheme) {