Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set badge to empty string if zero entries retrieved.
  • Loading branch information
amrod committed May 14, 2015
1 parent 8c9d838 commit b53c5d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions scripts/background.js
Expand Up @@ -90,8 +90,6 @@ chrome.alarms.create(alarmName, {delayInMinutes: 1, periodInMinutes: 1});
//console.log("Alarm set.");

chrome.alarms.onAlarm.addListener(function(alarm){
console.log("Alarm fired");
console.log(alarm);
if (alarm.name === alarmName) {
fr.updateBadge();
console.log("Badge updated");
Expand Down
7 changes: 6 additions & 1 deletion scripts/fasterredmine.js
Expand Up @@ -222,7 +222,12 @@ FasterRedmine.prototype.updateBadge = function() {
if (FasterRedmine.prototype.isValidURL(vars.atomFeed)) {
FasterRedmine.prototype.getAtomFeed(vars.atomFeed, function(data){
var entries = FasterRedmine.prototype.getAtomEntries(data);
chrome.browserAction.setBadgeText({text: entries.length.toString()});
var count = "";
if (entries.length > 0){
count = entries.length.toString();
}

chrome.browserAction.setBadgeText({text: count});
});
}
});
Expand Down
1 change: 0 additions & 1 deletion scripts/options.js
Expand Up @@ -39,7 +39,6 @@ function saveOptions() {
});

chrome.runtime.sendMessage({requestPermission: true, origins: [redmineUrl]}, function(response) {
console.log("options.js::saveOptions::sendMessage: requestPermission; response.granted = " + response.granted);
if (response.granted) {
notifyUser('Access to ' + redmineUrl + ' granted.');
refreshBrowserActionIconAllTabs();
Expand Down

0 comments on commit b53c5d7

Please sign in to comment.