Skip to content

Commit

Permalink
Improve notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jul 21, 2017
1 parent f5fcb91 commit 66adbdd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,22 @@ browser.storage.local.get('accessToken')

count = notifications.length;

if (!count) {
return;
}

let items = '';

notifications.forEach((notification) => {
items += '[' + notification.repository.full_name + '] ';
items += notification.subject.title;
items += "\n";
items += `[${notification.repository.full_name}] ${notification.subject.title} \n`;
});

browser.notifications.create({
type: "basic",
iconUrl: browser.extension.getURL("icons/github.png"),
title: "There are " + count + " new notifications",
title: count === 1
? `There is 1 new notification`
: `There are ${count} new notifications`,
message: items
});
});
Expand Down

0 comments on commit 66adbdd

Please sign in to comment.