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

GH-1262 Blocked count for Categories respects trust/restrict/pause #133

Merged
merged 2 commits into from Jul 12, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next
GH-1262 Trackers Blocked count for Blocking Categories respects trust…
…/restrict/pause
  • Loading branch information
IAmThePan committed Jul 12, 2018
commit cdc54895f2999d329e98b19c63e547795ae4ee8e
@@ -152,10 +152,20 @@ class Category extends React.Component {
* @return {ReactComponent} ReactComponent instance
*/
render() {
const { category } = this.props;
const { category, paused_blocking, sitePolicy } = this.props;
const globalBlocking = !!this.props.globalBlocking;
const filteredText = { color: 'red' };
const checkBoxStyle = `${(this.state.totalShownBlocked && this.state.allShownBlocked) ? 'all-blocked ' : (this.state.totalShownBlocked ? 'some-blocked ' : '')} checkbox-container`;

let trackersBlockedCount;
if (paused_blocking || sitePolicy === 2) {
trackersBlockedCount = 0;
} else if (sitePolicy === 1) {
trackersBlockedCount = category.num_total || 0;
} else {
trackersBlockedCount = category.num_blocked || 0;
}

return (
<div className={`${category.num_shown === 0 ? 'hide' : ''} blocking-category`}>
<div className={`sticky-category${this.state.showTooltip ? ' no-sticky' : ''}`}>
@@ -184,9 +194,9 @@ class Category extends React.Component {
</span>
</div>
{
!!category.num_blocked &&
!!trackersBlockedCount &&
<div className="blocked-count">
<span className="count">{`${category.num_blocked} `}</span>
<span className="count">{`${trackersBlockedCount} `}</span>
<span className="text">{ t('blocking_category_blocked') }</span>
</div>
}
ProTip! Use n and p to navigate between commits in a pull request.