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

GD-1665: User can not change a tracker’s status from “site restricted” to “block on all sites” #597

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -31,7 +31,7 @@ export const renderKnownTrackerButtons = (
</svg>
</span>
<span className={(!ss_blocked && !ss_allowed) ? 't-tooltip-up-left' : ''} data-g-tooltip={t('panel_tracker_block_tooltip')}>
<svg className="blocking-icons status" onClick={() => { if (ss_allowed || ss_blocked) { return; } clickTrackerStatus(); }} width="20px" height="20px" viewBox="0 0 20 20">
<svg className="blocking-icons status" onClick={clickTrackerStatus} width="20px" height="20px" viewBox="0 0 20 20">
<g transform="translate(1 1)" fill="none" fillRule="evenodd">
<path className="border" d="M-.5-.5h18.3v18.217H-.5z" />
<path className="background" d="M.5.5h16.3v16.217H.5z" />
@@ -83,18 +83,18 @@ const _updateTrackerTrustRestrict = (state, action) => {
updated_site_specific_unblocks = updateObject(siteSpecificUnblocks, pageHost, pageUnblocks);

// Site specific blocking
if (msg.restrict) {
if (!msg.trust) {
if (!pageBlocks.includes(app_id)) {
pageBlocks.push(app_id);
}
} else if (pageBlocks.includes(app_id)) {
} else
if (pageBlocks.includes(app_id)) {
pageBlocks.splice(pageBlocks.indexOf(app_id), 1);
}
updated_site_specific_blocks = updateObject(siteSpecificBlocks, pageHost, pageBlocks);

// update tracker category for site-specific blocking
const updated_category = updated_categories[updated_categories.findIndex(item => item.id === msg.cat_id)];

updated_category.trackers.forEach((trackerEl) => {
if (trackerEl.shouldShow) {
if (trackerEl.id === app_id) {
@@ -216,7 +216,12 @@ export default (state = initialState, action) => {
}
case UPDATE_TRACKER_BLOCKED: {
const updated = updateTrackerBlocked(state, action);
return { ...state, ...updated };
const other = _updateTrackerTrustRestrict(state, action);
const mix = {
...updated,
...other
};
return { ...state, ...mix };
}
case TOGGLE_EXPAND_ALL: {
const updated = toggleExpandAll(state, action);
ProTip! Use n and p to navigate between commits in a pull request.