Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
Fixing alarm + badge update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Apr 6, 2016
1 parent d1c417a commit a81bc5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@
*/

// alarms
chrome.alarms.create('badge', {periodInMinutes: 1});
chrome.alarms.create('badge', {delayInMinutes: 1, periodInMinutes: 1});
if (Settings.storage.get('notifUpdatesIsActivated') && Settings.storage.get('notifUpdatesFrequency')) {
chrome.alarms.create('notification', {periodInMinutes: parseInt(Settings.storage.get('notifUpdatesFrequency'))});
chrome.alarms.create('notification', {delayInMinutes: 1, periodInMinutes: parseInt(Settings.storage.get('notifUpdatesFrequency'))});
}
chrome.alarms.onAlarm.addListener(function (alarm) {
if (alarm.name == 'badge') {
chrome.runtime.sendMessage({do: 'update_badge'});
updateBadge();
}
if (alarm.name == 'notification') {
showNotificationUpdates();
Expand All @@ -392,8 +392,8 @@

// browser action
chrome.browserAction.onClicked.addListener(function () {
chrome.runtime.sendMessage({do: 'update_badge'});
chrome.runtime.sendMessage({do: 'show_updates_notification'});
updateBadge();
showNotificationUpdates();
openBattlelogHomeInTab();
});

Expand Down Expand Up @@ -434,7 +434,7 @@
case 'update':
console.log(manifest.name + " updated from v" + details.previousVersion + " to v" + manifest.version);
default:
chrome.runtime.sendMessage({do: 'update_badge'});
updateBadge();
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extName__",
"description": "__MSG_extDescription__",
"version": "0.1.7",
"version": "0.1.8",
"background": {
"persistent": false,
"scripts": [
Expand Down

0 comments on commit a81bc5d

Please sign in to comment.