Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader: Fix post card errors #78678

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/blocks/reader-combined-card/docs/example.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReaderCombinedCard, combinedCardPostKeyToKeys } from 'calypso/blocks/reader-combined-card';
import ReaderCombinedCard, { combinedCardPostKeyToKeys } from 'calypso/blocks/reader-combined-card';
import { posts, feed, site } from 'calypso/blocks/reader-post-card/docs/fixtures';

const postKey = {
Expand Down
2 changes: 1 addition & 1 deletion client/blocks/reader-excerpt/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const getDailyPromptText = ( post ) => {

const chooseExcerpt = ( post ) => {
// Need to figure out if custom excerpt is different to better_excerpt
if ( post.excerpt.length > 0 ) {
if ( post.excerpt?.length > 0 ) {
// If the post is a dailyprompt, attempt to replace the prompt text with a pullquote.
if ( post.tags && post.tags.hasOwnProperty( 'dailyprompt' ) ) {
const promptText = getDailyPromptText( post );
Expand Down
8 changes: 3 additions & 5 deletions client/blocks/reader-post-card/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,9 @@ export default connect(
ownProps.postKey &&
( isSiteWPForTeams( state, ownProps.postKey.blogId ) ||
isFeedWPForTeams( state, ownProps.postKey.feedId ) ),
hasOrganization: hasReaderFollowOrganization(
state,
ownProps.postKey.feedId,
ownProps.postKey.blogId
),
hasOrganization:
ownProps.postKey &&
hasReaderFollowOrganization( state, ownProps.postKey.feedId, ownProps.postKey.blogId ),
isExpanded: isReaderCardExpanded( state, ownProps.postKey ),
teams: getReaderTeams( state ),
} ),
Expand Down