Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: desktop-options.js

Issue 29615620: issue 6075 - Hide Acceptable Ads notification when corresponding subscription is removed (Closed)
Patch Set: Fixed characters limit Created Nov. 23, 2017, 5 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: desktop-options.js
===================================================================
--- a/desktop-options.js
+++ b/desktop-options.js
@@ -1118,6 +1118,22 @@
privacyList && privacyList.disabled == false;
}
+ function setPrivacyConflict()
+ {
+ let acceptableAdsForm = E("acceptable-ads");
+ if (hasPrivacyConflict())
+ {
+ getPref("ui_warn_tracking", (showTrackingWarning) =>
+ {
+ acceptableAdsForm.classList.toggle("show-warning", showTrackingWarning);
+ });
+ }
+ else
+ {
+ acceptableAdsForm.classList.remove("show-warning");
+ }
+ }
+
function populateLists()
{
subscriptionsMap = Object.create(null);
@@ -1267,6 +1283,7 @@
{
case "disabled":
updateSubscription(subscription);
+ setPrivacyConflict();
break;
case "downloading":
case "downloadStatus":
@@ -1291,17 +1308,8 @@
if (isAcceptableAds(url))
setAcceptableAds();
- if ((url == acceptableAdsUrl || recommended == "privacy") &&
- hasPrivacyConflict())
- {
- getPref("ui_warn_tracking", (showTrackingWarning) =>
- {
- if (showTrackingWarning)
- E("acceptable-ads").classList.add("show-warning");
- });
- }
-
collections.filterLists.addItem(subscription);
+ setPrivacyConflict();
break;
case "removed":
if (subscription.recommended)
@@ -1321,7 +1329,9 @@
collections.more.removeItem(subscription);
}
}
+
collections.filterLists.removeItem(subscription);
+ setPrivacyConflict();
break;
}
}
@@ -1376,8 +1386,7 @@
hidePref("notifications_ignoredcategories", !value);
break;
case "ui_warn_tracking":
- let showWarning = (value && hasPrivacyConflict());
- E("acceptable-ads").classList.toggle("show-warning", showWarning);
+ setPrivacyConflict();
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld