aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/erepublik/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/erepublik/webview.js')
-rw-r--r--recipes/erepublik/webview.js11
1 files changed, 2 insertions, 9 deletions
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