Skip to content

Commit

Permalink
Added additional guard for no event Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNawrocki committed Nov 5, 2024
1 parent 38c3f65 commit 42c699f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions layouts/Breaking/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class BreakingLayout extends React.Component {
}}
>
<div id="one">
{utilities.buildArticleCard(this.props.eventSummary, "breakingOverview")}
{this.props.eventSummary && utilities.buildArticleCard(this.props.eventSummary, "breakingOverview")}
</div>
<InfiniteScroll
pageStart={1}
Expand Down Expand Up @@ -152,7 +152,7 @@ export default class BreakingLayout extends React.Component {
>
<div>
<div id="one">
{utilities.buildArticleCard(this.props.eventSummary, "breakingOverview")}
{this.props.eventSummary && utilities.buildArticleCard(this.props.eventSummary, "breakingOverview")}
</div>
<InfiniteScroll
pageStart={1}
Expand Down Expand Up @@ -206,7 +206,7 @@ export default class BreakingLayout extends React.Component {
*/}
<div id="one" style={{position: "sticky", top: "70px"}}>
{utilities.buildArticleCard(this.props.eventSummary, "breakingOverview")}
{this.props.eventSummary && utilities.buildArticleCard(this.props.eventSummary, "breakingOverview")}
</div>
</div>
<div
Expand Down
4 changes: 3 additions & 1 deletion pages/category/breaking/[slug].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class Tag extends Component {
This is temporary for the event summary, we will have to make a new tag / category for event Summary then pluck that
*/
const eventSummary = eventSummaries[0];
eventSummary.excerpt.rendered = eventSummary.content.rendered; // Currently making the post content the excerpt in order to keep old card skeleton
if (eventSummary) {
eventSummary.excerpt.rendered = eventSummary.content.rendered; // Currently making the post content the excerpt in order to keep old card skeleton
}
return { tag, posts, eventSummary };
}
return { tag };
Expand Down

0 comments on commit 42c699f

Please sign in to comment.