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

Unified Diff: lib/notificationHelper.js

Issue 29370565: [adblockpluschrome] Issue 4764 - Added "relentless" notification that shows up in intervals (Closed)
Patch Set: Created Dec. 30, 2016, 9:50 a.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: lib/notificationHelper.js
diff --git a/lib/notificationHelper.js b/lib/notificationHelper.js
index 385614a351d505b1f665d9eb42ad484d47585f74..8ed75f8751f3c1db5007eebe4ff58e8cb81bf6c2 100644
--- a/lib/notificationHelper.js
+++ b/lib/notificationHelper.js
@@ -30,6 +30,7 @@ let displayMethods = Object.create(null);
displayMethods.critical = ["icon", "notification", "popup"];
displayMethods.question = ["notification"];
displayMethods.normal = ["notification"];
+displayMethods.relentless = ["notification"];
displayMethods.information = ["icon", "popup"];
// Chrome on Linux does not fully support chrome.notifications until version 35
@@ -98,7 +99,7 @@ function getNotificationButtons(notificationType, message)
}
];
}
- if (notificationType != "critical")
+ if (["critical", "relentless"].indexOf(notificationType) == -1)
Sebastian Noack 2017/01/05 12:46:11 Using indexOf() for membership checks seems unnece
wspee 2017/01/05 15:19:27 Done.
{
buttons.push({
type: "configure",
@@ -238,6 +239,9 @@ function showNotification(notification)
}
}
prepareNotificationIconAndPopup();
+
+ if (notification.type !== "question")
Sebastian Noack 2017/01/05 12:46:11 As per the Mozilla coding style guide (https://dev
wspee 2017/01/05 15:19:27 Done.
+ NotificationStorage.markAsShown(notification.id);
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld