diff options
Diffstat (limited to 'uncompressed/gmail/webview.js')
-rw-r--r-- | uncompressed/gmail/webview.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/uncompressed/gmail/webview.js b/uncompressed/gmail/webview.js index 521d4ad..febf64b 100644 --- a/uncompressed/gmail/webview.js +++ b/uncompressed/gmail/webview.js | |||
@@ -1,6 +1,6 @@ | |||
1 | "use strict"; | 1 | import path from 'path'; |
2 | 2 | ||
3 | module.exports = Franz => { | 3 | module.exports = (Franz) => { |
4 | const getMessages = function getMessages() { | 4 | const getMessages = function getMessages() { |
5 | let count = 0; | 5 | let count = 0; |
6 | 6 | ||
@@ -10,14 +10,17 @@ module.exports = Franz => { | |||
10 | } | 10 | } |
11 | } | 11 | } |
12 | 12 | ||
13 | // Just incase we don't end up with a number, set it back to zero (parseInt can return NaN) | ||
13 | count = parseInt(count, 10); | 14 | count = parseInt(count, 10); |
14 | |||
15 | if (isNaN(count)) { | 15 | if (isNaN(count)) { |
16 | count = 0; | 16 | count = 0; |
17 | } | 17 | } |
18 | 18 | ||
19 | // set Franz badge | ||
19 | Franz.setBadge(count); | 20 | Franz.setBadge(count); |
20 | }; | 21 | }; |
21 | 22 | ||
23 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
24 | // check for new messages every second and update Franz badge | ||
22 | Franz.loop(getMessages); | 25 | Franz.loop(getMessages); |
23 | }; \ No newline at end of file | 26 | }; |