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;