Skip to content

Commit

Permalink
More changes per review
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 3, 2017
1 parent 15e76f3 commit dd97399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions client/state/posts/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ export function editedPostHasContent( state, siteId, postId ) {
!! editedPost &&
(
some( [ 'title', 'excerpt' ], ( field ) => editedPost[ field ] && !! editedPost[ field ].trim() ) ||
/*
* We don't yet have the notion of post's raw content in the Redux state so we rely on post content attribute here
* when we do, we'll want it to reflect the Flux implementation's emptiness check
* where raw content is preferred to the content property if available
*/
! isEmptyContent( editedPost.content )
)
);
Expand Down
6 changes: 3 additions & 3 deletions client/state/sites/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1029,10 +1029,10 @@ export const hasDefaultSiteTitle = ( state, siteId ) => {
* @return {Boolean} true if the site's permalinks are editable
*/
export function areSitePermalinksEditable( state, siteId ) {
const site = getRawSite( state, siteId );
if ( ! site || ! site.options || ! site.options.permalink_structure ) {
const permalinkStructure = getSiteOption( state, siteId, 'permalink_structure' );
if ( ! permalinkStructure ) {
return false;
}

return /\/\%postname\%\/?/.test( site.options.permalink_structure );
return /\/\%postname\%\/?/.test( permalinkStructure );
}

0 comments on commit dd97399

Please sign in to comment.