From 4b88e8720ab0ebd3d1de07c172809c48a26ccc00 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 25 Sep 2019 16:44:21 -0400 Subject: [PATCH 1/2] Add ability to toggle smart blocking on Cliqz browser --- app/panel/components/Summary.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/panel/components/Summary.jsx b/app/panel/components/Summary.jsx index 5d51d254d..233dfd14d 100644 --- a/app/panel/components/Summary.jsx +++ b/app/panel/components/Summary.jsx @@ -418,7 +418,7 @@ class Summary extends React.Component { const { paused_blocking, sitePolicy } = this.props; const { disableBlocking } = this.state; - return paused_blocking || sitePolicy || disableBlocking || IS_CLIQZ; + return paused_blocking || sitePolicy || disableBlocking; } /** From 7ae7a2d255e33a766766f6a4c738b0f5fe0d3c51 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 25 Sep 2019 17:30:03 -0400 Subject: [PATCH 2/2] Refactor code to separate smart blocking inactive behavior --- app/panel/components/Summary.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/panel/components/Summary.jsx b/app/panel/components/Summary.jsx index 233dfd14d..063f607be 100644 --- a/app/panel/components/Summary.jsx +++ b/app/panel/components/Summary.jsx @@ -418,6 +418,13 @@ class Summary extends React.Component { const { paused_blocking, sitePolicy } = this.props; const { disableBlocking } = this.state; + return paused_blocking || sitePolicy || disableBlocking || IS_CLIQZ; + } + + _isSmartBlockingInactive() { + const { paused_blocking, sitePolicy } = this.props; + const { disableBlocking } = this.state; + return paused_blocking || sitePolicy || disableBlocking; } @@ -672,7 +679,7 @@ class Summary extends React.Component { clickButton={this.clickCliqzFeature} type="smart_block" active={enable_smart_block} - cliqzInactive={this._isCliqzInactive()} + cliqzInactive={this._isSmartBlockingInactive()} isSmaller={is_expert && !isCondensed} isCondensed={isCondensed} isTooltipHeader={is_expert}