Skip to content

Commit

Permalink
Jetpack /posts: enable counts and showing/hiding filters
Browse files Browse the repository at this point in the history
  • Loading branch information
lamosty committed Oct 21, 2016
1 parent c0682e2 commit fb77443
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions client/my-sites/posts/posts-navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ export default React.createClass( {

_getStatusTabs( author, siteFilter ) {
var statusItems = [],
isJetpackSite = this.props.sites.getSelectedSite().jetpack,
status, selectedText, selectedCount;

for ( status in this.filterStatuses ) {
if ( 'undefined' === typeof this.state.counts[ status ] &&
( ! isJetpackSite ) && 'publish' !== status ) {
if ( 'undefined' === typeof this.state.counts[ status ] && 'publish' !== status ) {
continue;
}

Expand All @@ -156,16 +154,14 @@ export default React.createClass( {

let textItem = this.filterStatuses[ status ];

let count = ( ! isJetpackSite ) && false !== this.state.counts[ status ]
let count = false !== this.state.counts[ status ]
? this.state.counts[ status ]
: false;

if ( path === this.props.context.pathname ) {
selectedText = textItem;

if ( ! isJetpackSite ) {
selectedCount = count;
}
selectedCount = count;
}

if ( 'publish' === status && ! count ) {
Expand All @@ -177,10 +173,7 @@ export default React.createClass( {
className={ 'is-' + status }
key={ 'statusTabs' + path }
path={ path }
count={ null === this.props.sites.selected || isJetpackSite ?
null :
count
}
count={ null === this.props.sites.selected || count }
value={ textItem }
selected={ path === this.props.context.pathname }>
{ textItem }
Expand Down

0 comments on commit fb77443

Please sign in to comment.