aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/redditchat
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/redditchat')
-rw-r--r--recipes/redditchat/index.js2
-rw-r--r--recipes/redditchat/webview.js10
2 files changed, 5 insertions, 7 deletions
diff --git a/recipes/redditchat/index.js b/recipes/redditchat/index.js
index 2fee1a8..46f936f 100644
--- a/recipes/redditchat/index.js
+++ b/recipes/redditchat/index.js
@@ -1,2 +1,2 @@
1// just pass through Franz 1// just pass through Franz
2module.exports = Franz => Franz; \ No newline at end of file 2module.exports = Franz => Franz;
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
3module.exports = Franz => { 1module.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};