diff options
Diffstat (limited to 'recipes/facebook')
-rwxr-xr-x | recipes/facebook/webview.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/recipes/facebook/webview.js b/recipes/facebook/webview.js index 392d891..17ab011 100755 --- a/recipes/facebook/webview.js +++ b/recipes/facebook/webview.js | |||
@@ -1,20 +1,19 @@ | |||
1 | module.exports = (Franz) => { | 1 | module.exports = (Franz) => { |
2 | const getNotifications = function getNotifications() { | 2 | const getNotifications = function getNotifications() { |
3 | let count = 0; | ||
3 | 4 | ||
4 | var count = 0; | 5 | const elements = [ |
6 | document.getElementById('requestsCountValue'), | ||
7 | // document.getElementById('mercurymessagesCountValue'), | ||
8 | document.getElementById('notificationsCountValue'), | ||
9 | document.querySelector('.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn'), | ||
10 | ]; | ||
5 | 11 | ||
6 | var elements = [ | 12 | elements.forEach((element) => { |
7 | document.getElementById('requestsCountValue'), | 13 | if (element !== null && parseInt(element.innerHTML, 10)) { |
8 | // document.getElementById('mercurymessagesCountValue'), | 14 | count += parseInt(element.innerHTML, 10); |
9 | document.getElementById('notificationsCountValue'), | 15 | } |
10 | document.querySelector('.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn'), | 16 | }); |
11 | ] | ||
12 | |||
13 | elements.forEach(function(element){ | ||
14 | if(element !== null && parseInt(element.innerHTML, 10)){ | ||
15 | count += parseInt(element.innerHTML, 10); | ||
16 | } | ||
17 | }) | ||
18 | 17 | ||
19 | Franz.setBadge(count); | 18 | Franz.setBadge(count); |
20 | }; | 19 | }; |