forked from meetfranz/plugins-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebview.js
More file actions
22 lines (17 loc) · 658 Bytes
/
webview.js
File metadata and controls
22 lines (17 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const path = require('path');
module.exports = (Franz, options) => {
const getMessages = () => {
// get unread messages
const updates = document.getElementById('franz').getAttribute('data-unread');
// get conversations in 'My Inbox'
const inbox = document.getElementById('franz').getAttribute('data-inbox');
// set Franz badge
// updates => active unread count
// inbox => passive unread count
Franz.setBadge(updates, inbox);
};
// inject franz.css stylesheet
Franz.injectCSS(path.join(__dirname, 'css', 'franz.css'));
// check for new messages every second and update Franz badge
Franz.loop(getMessages);
};