Skip to content

Commit

Permalink
Update Home Page content after cache hit (magento#2230)
Browse files Browse the repository at this point in the history
- Remove redundant loading flag and null response on no data
  • Loading branch information
davemacaulay committed Jun 3, 2020
1 parent 7aa2b97 commit 41fe91e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/venia-ui/lib/RootComponents/CMS/cms.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import defaultClasses from './cms.css';
const CMSPage = props => {
const { id } = props;
const classes = mergeClasses(defaultClasses, props.classes);
const { loading, error, data } = useQuery(cmsPageQuery, {
const { error, data } = useQuery(cmsPageQuery, {
variables: {
id: Number(id),
onServer: false
Expand All @@ -28,12 +28,8 @@ const CMSPage = props => {
return <div>Page Fetch Error</div>;
}

if (loading && (!data && !data.cmsPage)) {
return fullPageLoadingIndicator;
}

if (!data) {
return null;
return fullPageLoadingIndicator;
}

const { content_heading, title } = data.cmsPage;
Expand Down

0 comments on commit 41fe91e

Please sign in to comment.