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/redditchat/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/redditchat/webview.js')
-rw-r--r-- | recipes/redditchat/webview.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/recipes/redditchat/webview.js b/recipes/redditchat/webview.js index 7e209da..8b29861 100644 --- a/recipes/redditchat/webview.js +++ b/recipes/redditchat/webview.js | |||
@@ -1,13 +1,11 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = Franz => { | 1 | module.exports = Franz => { |
4 | // Regular expression for (*) or (1), will extract the asterisk or the number | 2 | // Regular expression for (*) or (1), will extract the asterisk or the number |
5 | const titleRegEx = /^\(([\*\d])\)/; | 3 | const titleRegEx = /^\(([\*\d])\)/; |
6 | const getMessages = function unreadCount() { | 4 | const getMessages = function unreadCount() { |
7 | var directCount = 0; | 5 | let directCount = 0; |
8 | var indirectCount = 0; | 6 | let indirectCount = 0; |
9 | 7 | ||
10 | var matchArr = document.title.match(titleRegEx); | 8 | const matchArr = document.title.match(titleRegEx); |
11 | if (matchArr) { | 9 | if (matchArr) { |
12 | if (matchArr[1] === '*') { | 10 | if (matchArr[1] === '*') { |
13 | indirectCount = 1; | 11 | indirectCount = 1; |
@@ -17,7 +15,7 @@ module.exports = Franz => { | |||
17 | } | 15 | } |
18 | 16 | ||
19 | Franz.setBadge(directCount, indirectCount); | 17 | Franz.setBadge(directCount, indirectCount); |
20 | } | 18 | }; |
21 | 19 | ||
22 | Franz.loop(getMessages); | 20 | Franz.loop(getMessages); |
23 | }; | 21 | }; |