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

Commit

Permalink
Fixing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Aug 8, 2015
1 parent 0755b72 commit b5a04ea
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,21 @@
switch(status) {
case 'ingame':
color = colorIngame;
if (Settings.storage.get('iconShowIngame') == 'false') {
if (!Settings.storage.get('iconShowIngame')) {
count = '0';
badgeText = false;
}
break;
case 'online':
color = colorOnline;
if (Settings.storage.get('iconShowOnline') == 'false') {
if (!Settings.storage.get('iconShowOnline')) {
count = '0';
badgeText = false;
}
break;
case 'offline':
color = colorOffline;
if (Settings.storage.get('iconShowOffline') == 'false') {
if (!Settings.storage.get('iconShowOffline')) {
count = '0';
badgeText = false;
}
Expand All @@ -205,10 +205,10 @@

function showNotificationUpdates() {
var sound = false;
if (!chrome.notifications || Settings.storage.get('notifUpdatesIsActivated') != 'true') {
if (!chrome.notifications || !Settings.storage.get('notifUpdatesIsActivated')) {
return;
}
if (Settings.storage.get('notifUpdatesIsSound') == 'true') {
if (Settings.storage.get('notifUpdatesIsSound')) {
sound = true;
}
new NotificationsCount(function (count) {
Expand Down Expand Up @@ -378,7 +378,7 @@

// alarms
chrome.alarms.create('badge', {periodInMinutes: 1});
if (Settings.storage.get('notifUpdatesIsActivated') == 'true' && Settings.storage.get('notifUpdatesFrequency')) {
if (Settings.storage.get('notifUpdatesIsActivated') && Settings.storage.get('notifUpdatesFrequency')) {
chrome.alarms.create('notification', {periodInMinutes: parseInt(Settings.storage.get('notifUpdatesFrequency'))});
}
chrome.alarms.onAlarm.addListener(function (alarm) {
Expand Down Expand Up @@ -450,9 +450,10 @@
if (!chrome.notifications) {
return;
}
if (Settings.storage.get('notifUpdatesIsSound') == 'true') {
if (Settings.storage.get('notifUpdatesIsSound')) {
sound = true;
}
console.log('sound? ' + sound);
renderUpdatesNotification(Math.floor((Math.random()*10)+1), sound);
break;
case 'show_friends_notification_test':
Expand Down

0 comments on commit b5a04ea

Please sign in to comment.