mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
[WEB-1465] fix: theme fluctuation on initial load. (#4638)
This commit is contained in:
parent
8a30c2c484
commit
10ef4e657f
@ -14,7 +14,7 @@ type TStoreWrapper = {
|
||||
const StoreWrapper: FC<TStoreWrapper> = 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<TStoreWrapper> = 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user