Skip to content

Commit

Permalink
wip, show error message when product id is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Nov 22, 2022
1 parent c453842 commit 6fff576
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/ItemView/ItemView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function ItemView(props) {
return p.code.includes('DAT');
})[0]?.code;

const rawTitle = title?.raw || '';
const rawTitle = item && item._meta.found ? title?.raw || '' : docid;

React.useEffect(() => {
const handler = async () => {
Expand Down Expand Up @@ -67,7 +67,7 @@ function ItemView(props) {
handler();
}, [item, dispatch, docid, rawTitle]);

return item ? (
return item && item._meta.found ? (
<div className="dataset-view">
<Portal node={document.getElementById('page-header')}>
<div className="dataset">
Expand Down Expand Up @@ -127,7 +127,9 @@ function ItemView(props) {
</div>
</div> */}
</div>
) : null;
) : (
<div>Data series not found</div>
);
}

function DatahubItemView(props) {
Expand Down

0 comments on commit 6fff576

Please sign in to comment.