From 645b78d033fed47aea4077d78bb4715a90e82b4d Mon Sep 17 00:00:00 2001 From: Rares Mardare Date: Mon, 26 Sep 2022 14:17:17 +0300 Subject: [PATCH] conditional useStore --- .../PageErrorHandlingWrapper/PageErrorHandlingWrapper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grafana-plugin/src/components/PageErrorHandlingWrapper/PageErrorHandlingWrapper.tsx b/grafana-plugin/src/components/PageErrorHandlingWrapper/PageErrorHandlingWrapper.tsx index f53193bd..5d0445ba 100644 --- a/grafana-plugin/src/components/PageErrorHandlingWrapper/PageErrorHandlingWrapper.tsx +++ b/grafana-plugin/src/components/PageErrorHandlingWrapper/PageErrorHandlingWrapper.tsx @@ -46,10 +46,10 @@ export default function PageErrorHandlingWrapper({ } }, [errorData.isNotFoundError]); - if (!errorData.isWrongTeamError) {return children();} - const store = useStore(); + if (!errorData.isWrongTeamError) {return children();} + const currentTeamId = store.userStore.currentUser?.current_team; const currentTeam = store.grafanaTeamStore.items[currentTeamId]?.name;