Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 07702ff

Browse files
committed
fix loading confusing message and front page product area link
1 parent 9570b52 commit 07702ff

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

components/productArea/productAreaLinks.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const ProductAreaHasItems = (p: any)=> !!p?.teams.filter((it: any)=> it.dataprod
66

77
const ProductAreaLinks = () => {
88
var defaultProductAreaID = '6b149078-927b-4570-a1ce-97bbb9499fb6'
9-
const {productAreas} = useGetProductAreas()
9+
const {productAreas, error} = useGetProductAreas()
1010
const productAreaWithItems = productAreas?.filter(it=> ProductAreaHasItems(it));
1111
if(productAreaWithItems.length>0){
1212
defaultProductAreaID = productAreaWithItems.find(it=> it.id== defaultProductAreaID)?.id || productAreaWithItems[0].id
13-
}else{
13+
}else if(error){
1414
return null
1515
}
1616

pages/dataproduct/new.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ import {
88
import { GetServerSideProps } from 'next'
99
import { addApolloState, initializeApollo } from '../../lib/apollo'
1010
import InnerContainer from '../../components/lib/innerContainer'
11+
import LoaderSpinner from '../../components/lib/spinner'
1112

1213
const NewDataproduct = () => {
1314
const userInfo = useUserInfoDetailsQuery()
1415

16+
if(!userInfo || userInfo.loading){
17+
return <LoaderSpinner />
18+
}
19+
1520
if (!userInfo.data?.userInfo)
1621
return (
1722
<div>

pages/insightProduct/new.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ import {
88
import { GetServerSideProps } from 'next'
99
import { addApolloState, initializeApollo } from '../../lib/apollo'
1010
import InnerContainer from '../../components/lib/innerContainer'
11+
import LoaderSpinner from '../../components/lib/spinner'
1112

1213
const NewInsightProduct = () => {
1314
const userInfo = useUserInfoDetailsQuery()
1415

16+
if(!userInfo || userInfo.loading){
17+
return <LoaderSpinner />
18+
}
19+
1520
if (!userInfo.data?.userInfo)
1621
return (
1722
<div>

pages/story/new.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ import {
88
import { GetServerSideProps } from 'next'
99
import { addApolloState, initializeApollo } from '../../lib/apollo'
1010
import InnerContainer from '../../components/lib/innerContainer'
11+
import LoaderSpinner from '../../components/lib/spinner'
1112

1213
const NewStory = () => {
1314
const userInfo = useUserInfoDetailsQuery()
1415

16+
if(!userInfo || userInfo.loading){
17+
return <LoaderSpinner />
18+
}
19+
1520
if (!userInfo.data?.userInfo)
1621
return (
1722
<div>

pages/user/[[...page]].tsx

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export const UserPages = () => {
1818

1919
if (error) return <ErrorMessage error={error} />
2020
if (loading || !data) return <LoaderSpinner />
21+
22+
if(loading){
23+
return <LoaderSpinner />
24+
}
25+
2126
if (!data.userInfo)
2227
return (
2328
<div>

0 commit comments

Comments
 (0)