diff options
author | 2019-11-15 16:34:27 +0100 | |
---|---|---|
committer | 2019-11-15 16:34:27 +0100 | |
commit | 67f193af924fcebacf59a99bb18ea8ab17718900 (patch) | |
tree | 25b950d519aad5ca11b79b5f4535f035dfee85b4 /uncompressed/gmail/webview.js | |
parent | Serve recipe icons from recipe repo (diff) | |
download | ferdium-recipes-67f193af924fcebacf59a99bb18ea8ab17718900.tar.gz ferdium-recipes-67f193af924fcebacf59a99bb18ea8ab17718900.tar.zst ferdium-recipes-67f193af924fcebacf59a99bb18ea8ab17718900.zip |
Update GMail recipe
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 | }; |