diff --git a/app/browse/datatable.tsx b/app/browse/datatable.tsx index 0afcfa5d52..133e31c726 100644 --- a/app/browse/datatable.tsx +++ b/app/browse/datatable.tsx @@ -216,7 +216,7 @@ export const DataSetPreviewTable = ({ title: string; dimensions: DimensionMetadataFragment[]; measures: DimensionMetadataFragment[]; - observations: Observation[]; + observations: Observation[] | undefined; }) => { const headers = useMemo(() => { return getSortedColumns([...dimensions, ...measures]); diff --git a/app/browser/dataset-preview.tsx b/app/browser/dataset-preview.tsx index 700cad991d..dad4d2d722 100644 --- a/app/browser/dataset-preview.tsx +++ b/app/browser/dataset-preview.tsx @@ -108,7 +108,13 @@ export const DataSetPreview = ({ window.scrollTo({ top: 0 }); }, []); - if (metadata?.dataCubeByIri) { + if (fetching) { + return ( + + + + ); + } else if (metadata?.dataCubeByIri) { const { dataCubeByIri } = metadata; return ( @@ -188,12 +194,6 @@ export const DataSetPreview = ({ ); - } else if (fetching) { - return ( - - - - ); } else { return ( diff --git a/app/components/use-redirect-to-versioned-cube.tsx b/app/components/use-redirect-to-versioned-cube.tsx index a5902f1f75..ea77c34c6e 100644 --- a/app/components/use-redirect-to-versioned-cube.tsx +++ b/app/components/use-redirect-to-versioned-cube.tsx @@ -48,7 +48,7 @@ export const useRedirectToVersionedCube = ({ if (resp) { router.replace({ - pathname: `/browse`, + pathname: "browse", query: { ...router.query, ...(router.query.iri ? { iri: resp.iri } : { dataset: resp.iri }),