diff options
author | Vijay A <avijayr@protonmail.com> | 2021-07-31 15:28:23 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-07-31 15:28:23 +0530 |
commit | 97697e3d069972844b2912a93022f4a4904a40d6 (patch) | |
tree | 53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/facebook/webview.js | |
parent | Allow any url in the custom-service to allow for sites like 'http://translate... (diff) | |
download | ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.gz ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.zst ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.zip |
Fixed eslintrc as root for this folder; Reformatted all files.
Diffstat (limited to 'recipes/facebook/webview.js')
-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 | }; |