diff options
Diffstat (limited to 'uncompressed/zeplin/webview.js')
-rw-r--r-- | uncompressed/zeplin/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uncompressed/zeplin/webview.js b/uncompressed/zeplin/webview.js new file mode 100644 index 0000000..2e87537 --- /dev/null +++ b/uncompressed/zeplin/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | const path = require('path'); | ||
4 | |||
5 | module.exports = Franz => { | ||
6 | const getMessages = () => { | ||
7 | const totalNotifications = document.querySelectorAll('#notificationList > .notification').length; | ||
8 | const hasUnread = document.querySelectorAll('#notificationsButton.hasUnread').length > 0; | ||
9 | |||
10 | // set Franz badge | ||
11 | if (hasUnread) { | ||
12 | Franz.setBadge(totalNotifications); | ||
13 | } | ||
14 | }; | ||
15 | |||
16 | Franz.loop(getMessages); | ||
17 | }; | ||