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: Created Nov. 22, 2017, 1:27 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
@@ -1101,6 +1101,12 @@
return url == acceptableAdsUrl || url == acceptableAdsPrivacyUrl;
}
+ function isConflictingSubscription(subscription)
+ {
+ return subscription.url == acceptableAdsUrl ||
Thomas Greiner 2017/11/23 14:46:12 Suggestion: If you want you can pass an optional `
saroyanm 2017/11/23 16:41:37 Not sure if it will help much and it might complic
+ subscription.recommended == "privacy"
+ }
+
function hasPrivacyConflict()
Thomas Greiner 2017/11/23 14:46:12 I wouldn't mind keeping the privacy conflict check
saroyanm 2017/11/23 16:41:37 Agree, done.
{
let acceptableAdsList = subscriptionsMap[acceptableAdsUrl];
@@ -1291,8 +1297,7 @@
if (isAcceptableAds(url))
setAcceptableAds();
- if ((url == acceptableAdsUrl || recommended == "privacy") &&
- hasPrivacyConflict())
+ if (isConflictingSubscription(subscription) && hasPrivacyConflict())
{
getPref("ui_warn_tracking", (showTrackingWarning) =>
{
@@ -1321,6 +1326,11 @@
collections.more.removeItem(subscription);
}
}
+ if (isConflictingSubscription(subscription))
+ {
+ E("acceptable-ads").classList.remove("show-warning");
+ }
Thomas Greiner 2017/11/23 12:53:39 Why not instead introduce a function similar to `s
saroyanm 2017/11/23 14:06:51 Good point, done.
+
collections.filterLists.removeItem(subscription);
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