diff options
Diffstat (limited to 'recipes/github')
-rw-r--r-- | recipes/github/package.json | 2 | ||||
-rw-r--r-- | recipes/github/webview.js | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/recipes/github/package.json b/recipes/github/package.json index 4454c97..2ed611e 100644 --- a/recipes/github/package.json +++ b/recipes/github/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "github", | 2 | "id": "github", |
3 | "name": "GitHub", | 3 | "name": "GitHub", |
4 | "version": "2.1.0", | 4 | "version": "2.1.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://github.com/notifications", | 7 | "serviceURL": "https://github.com/notifications", |
diff --git a/recipes/github/webview.js b/recipes/github/webview.js index 9f35b5e..fdc65a8 100644 --- a/recipes/github/webview.js +++ b/recipes/github/webview.js | |||
@@ -1,14 +1,17 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = function getMessages() { | 2 | const getMessages = function getMessages() { |
3 | const directCountElement = document.querySelector('.filter-list .count'); | 3 | const directCountElement = document.querySelector('.filter-list .count'); |
4 | const indirectCountElement = document.querySelector('[class*="mail-status unread"]'); | 4 | let directCount = 0; |
5 | let directCount; | ||
6 | let indirectCount; | ||
7 | if (directCountElement) { | 5 | if (directCountElement) { |
8 | directCount = parseInt(directCountElement.innerHTML, 10); | 6 | directCount = Ferdi.safeParseInt(directCountElement.innerHTML); |
9 | } else if (indirectCountElement) { | 7 | } |
8 | |||
9 | const indirectCountElement = document.querySelector('[class*="mail-status unread"]'); | ||
10 | let indirectCount = 0; | ||
11 | if (indirectCountElement) { | ||
10 | indirectCount = 1; | 12 | indirectCount = 1; |
11 | } | 13 | } |
14 | |||
12 | Ferdi.setBadge(directCount, indirectCount); | 15 | Ferdi.setBadge(directCount, indirectCount); |
13 | }; | 16 | }; |
14 | 17 | ||