diff options
Diffstat (limited to 'recipes/nomadlist/webview.js')
-rw-r--r-- | recipes/nomadlist/webview.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/recipes/nomadlist/webview.js b/recipes/nomadlist/webview.js new file mode 100644 index 0000000..a754a5f --- /dev/null +++ b/recipes/nomadlist/webview.js | |||
@@ -0,0 +1,21 @@ | |||
1 | const path = require('path'); | ||
2 | |||
3 | module.exports = (Franz, options) => { | ||
4 | const getMessages = () => { | ||
5 | // get unread messages | ||
6 | // const updates = document.getElementById('franz').getAttribute('data-unread'); | ||
7 | const count = $(".unread").length; | ||
8 | Franz.setBadge(count); | ||
9 | |||
10 | // get conversations in 'My Inbox' | ||
11 | // const inbox = document.getElementById('franz').getAttribute('data-inbox'); | ||
12 | |||
13 | // set Franz badge | ||
14 | // updates => active unread count | ||
15 | // inbox => passive unread count | ||
16 | // Franz.setBadge(updates, inbox); | ||
17 | }; | ||
18 | |||
19 | // check for new messages every second and update Franz badge | ||
20 | Franz.loop(getMessages); | ||
21 | }; \ No newline at end of file | ||