From 10ef4e657ffb3e9e88ceeb9ff9ba8fe61b2a7dbd Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Wed, 29 May 2024 18:21:33 +0530 Subject: [PATCH] [WEB-1465] fix: theme fluctuation on initial load. (#4638) --- web/lib/wrappers/store-wrapper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/lib/wrappers/store-wrapper.tsx b/web/lib/wrappers/store-wrapper.tsx index e4e191d5a..785e929ea 100644 --- a/web/lib/wrappers/store-wrapper.tsx +++ b/web/lib/wrappers/store-wrapper.tsx @@ -14,7 +14,7 @@ type TStoreWrapper = { const StoreWrapper: FC = observer((props) => { const { children } = props; // theme - const { setTheme } = useTheme(); + const {resolvedTheme, setTheme } = useTheme(); // router const router = useRouter(); // store hooks @@ -38,7 +38,7 @@ const StoreWrapper: FC = observer((props) => { * Setting up the theme of the user by fetching it from local storage */ useEffect(() => { - setTheme(userProfile?.theme?.theme || "system"); + setTheme(userProfile?.theme?.theme || resolvedTheme || "system"); if (!userProfile?.theme?.theme) return; if (userProfile?.theme?.theme === "custom" && userProfile?.theme?.palette) {