diff options
Diffstat (limited to 'recipes/erepublik')
-rw-r--r-- | recipes/erepublik/package.json | 2 | ||||
-rw-r--r-- | recipes/erepublik/webview.js | 11 |
2 files changed, 3 insertions, 10 deletions
diff --git a/recipes/erepublik/package.json b/recipes/erepublik/package.json index 77781ee..c8efaab 100644 --- a/recipes/erepublik/package.json +++ b/recipes/erepublik/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "erepublik", | 2 | "id": "erepublik", |
3 | "name": "eRepublik", | 3 | "name": "eRepublik", |
4 | "version": "1.1.0", | 4 | "version": "1.1.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://erepublik.com" | 7 | "serviceURL": "https://erepublik.com" |
diff --git a/recipes/erepublik/webview.js b/recipes/erepublik/webview.js index 3056d1b..7c24532 100644 --- a/recipes/erepublik/webview.js +++ b/recipes/erepublik/webview.js | |||
@@ -12,20 +12,13 @@ module.exports = Ferdi => { | |||
12 | 12 | ||
13 | for (let i = 0; i < elementNotify.length; i++) { | 13 | for (let i = 0; i < elementNotify.length; i++) { |
14 | const splitText = elementNotify[i].title.split(':'); | 14 | const splitText = elementNotify[i].title.split(':'); |
15 | const badgeNumber = parseInt(splitText[1], 10); | 15 | countNotify += Ferdi.safeParseInt(splitText[1]); |
16 | if (badgeNumber) { | ||
17 | countNotify += badgeNumber; | ||
18 | } | ||
19 | } | 16 | } |
20 | 17 | ||
21 | for (let i = 0; i < elementFeed.length; i++) { | 18 | for (let i = 0; i < elementFeed.length; i++) { |
22 | const feedNumber = parseInt(elementFeed[i].textContent, 10); | 19 | countFeed += Ferdi.safeParseInt(elementFeed[i].textContent); |
23 | if (feedNumber) { | ||
24 | countFeed += feedNumber; | ||
25 | } | ||
26 | } | 20 | } |
27 | 21 | ||
28 | console.log(countNotify, countFeed); | ||
29 | Ferdi.setBadge(countNotify, countFeed); | 22 | Ferdi.setBadge(countNotify, countFeed); |
30 | }; | 23 | }; |
31 | 24 | ||