aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/zeplin/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/zeplin/webview.js')
-rw-r--r--recipes/zeplin/webview.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes/zeplin/webview.js b/recipes/zeplin/webview.js
new file mode 100644
index 0000000..2e87537
--- /dev/null
+++ b/recipes/zeplin/webview.js
@@ -0,0 +1,17 @@
1'use strict';
2
3const path = require('path');
4
5module.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};