]> git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/blobdiff - javascript/clearhistory.js
fix notification message when deleting old history
[chrome-ext/clearhistory-advance-fork.git] / javascript / clearhistory.js
index f614fff5e9844130d6ba4d74e0f3c9323f3dc4c6..28eb2b060676ec161b554e177389f5316b24885a 100644 (file)
@@ -67,10 +67,10 @@ function clearDownloads(s) {
 function didClearHistory(s) {
   var time = ~~(s.time) || CONSTANTS.DEFAULT_TIME;
   time = getUnitsForTime(time);
-  var timeString = (time.time === -1) ?
-                   chrome.i18n.getMessage('notificationTimeAll') :
-                   chrome.i18n.getMessage('notificationTime',
-                                          [time.time, time.units]);
+  var timeMsg = (time.time === -1) ? 'notificationTimeAll' :
+                (s.timeStart === CONSTANTS.YES) ? 'notificationTimeNewer' :
+                'notificationTimeOlder';
+  var timeString = chrome.i18n.getMessage(timeMsg, [time.time, time.units]);
   var message = chrome.i18n.getMessage('notificationBody', timeString);
   var notification = webkitNotifications.createNotification(
       chrome.extension.getURL('/images/icon48.png'),