diff --git a/components/productArea/productAreaLinks.tsx b/components/productArea/productAreaLinks.tsx index 61de2c31..56d074b7 100644 --- a/components/productArea/productAreaLinks.tsx +++ b/components/productArea/productAreaLinks.tsx @@ -6,11 +6,11 @@ const ProductAreaHasItems = (p: any)=> !!p?.teams.filter((it: any)=> it.dataprod const ProductAreaLinks = () => { var defaultProductAreaID = '6b149078-927b-4570-a1ce-97bbb9499fb6' - const {productAreas} = useGetProductAreas() + const {productAreas, error} = useGetProductAreas() const productAreaWithItems = productAreas?.filter(it=> ProductAreaHasItems(it)); if(productAreaWithItems.length>0){ defaultProductAreaID = productAreaWithItems.find(it=> it.id== defaultProductAreaID)?.id || productAreaWithItems[0].id - }else{ + }else if(error){ return null } diff --git a/pages/dataproduct/new.tsx b/pages/dataproduct/new.tsx index 9215a837..80147628 100644 --- a/pages/dataproduct/new.tsx +++ b/pages/dataproduct/new.tsx @@ -8,10 +8,15 @@ import { import { GetServerSideProps } from 'next' import { addApolloState, initializeApollo } from '../../lib/apollo' import InnerContainer from '../../components/lib/innerContainer' +import LoaderSpinner from '../../components/lib/spinner' const NewDataproduct = () => { const userInfo = useUserInfoDetailsQuery() + if(!userInfo || userInfo.loading){ + return + } + if (!userInfo.data?.userInfo) return (
diff --git a/pages/insightProduct/new.tsx b/pages/insightProduct/new.tsx index d9eb5c7a..8d519f0a 100644 --- a/pages/insightProduct/new.tsx +++ b/pages/insightProduct/new.tsx @@ -8,10 +8,15 @@ import { import { GetServerSideProps } from 'next' import { addApolloState, initializeApollo } from '../../lib/apollo' import InnerContainer from '../../components/lib/innerContainer' +import LoaderSpinner from '../../components/lib/spinner' const NewInsightProduct = () => { const userInfo = useUserInfoDetailsQuery() + if(!userInfo || userInfo.loading){ + return + } + if (!userInfo.data?.userInfo) return (
diff --git a/pages/story/new.tsx b/pages/story/new.tsx index 051ba633..1a41c584 100644 --- a/pages/story/new.tsx +++ b/pages/story/new.tsx @@ -8,10 +8,15 @@ import { import { GetServerSideProps } from 'next' import { addApolloState, initializeApollo } from '../../lib/apollo' import InnerContainer from '../../components/lib/innerContainer' +import LoaderSpinner from '../../components/lib/spinner' const NewStory = () => { const userInfo = useUserInfoDetailsQuery() + if(!userInfo || userInfo.loading){ + return + } + if (!userInfo.data?.userInfo) return (
diff --git a/pages/user/[[...page]].tsx b/pages/user/[[...page]].tsx index 640bbd5b..8c62abb2 100644 --- a/pages/user/[[...page]].tsx +++ b/pages/user/[[...page]].tsx @@ -18,6 +18,11 @@ export const UserPages = () => { if (error) return if (loading || !data) return + + if(loading){ + return + } + if (!data.userInfo) return (