From 732e33fefcd49eb9a3de4f5d3e6098c07d0b09f7 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:30:17 +0530 Subject: [PATCH] fix: wrap the project auth wrapper with observer (#2459) --- web/layouts/auth-layout/project-wrapper.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/layouts/auth-layout/project-wrapper.tsx b/web/layouts/auth-layout/project-wrapper.tsx index 1ae3e71f6..f594dcd8e 100644 --- a/web/layouts/auth-layout/project-wrapper.tsx +++ b/web/layouts/auth-layout/project-wrapper.tsx @@ -1,5 +1,6 @@ import { FC, ReactNode } from "react"; import { useRouter } from "next/router"; +import { observer } from "mobx-react-lite"; import useSWR from "swr"; // hooks import { useMobxStore } from "lib/mobx/store-provider"; @@ -14,7 +15,7 @@ interface IProjectAuthWrapper { children: ReactNode; } -export const ProjectAuthWrapper: FC = (props) => { +export const ProjectAuthWrapper: FC = observer((props) => { const { children } = props; // store const { user: userStore, project: projectStore } = useMobxStore(); @@ -88,4 +89,4 @@ export const ProjectAuthWrapper: FC = (props) => { } return <>{children}; -}; +});