diff options
Diffstat (limited to 'recipes/nextdoor/webview.js')
-rw-r--r-- | recipes/nextdoor/webview.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/recipes/nextdoor/webview.js b/recipes/nextdoor/webview.js index bec9944..ea110b8 100644 --- a/recipes/nextdoor/webview.js +++ b/recipes/nextdoor/webview.js | |||
@@ -1,14 +1,22 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let unread = 0; | 9 | let unread = 0; |
4 | const notificationBadge = document.querySelectorAll( | 10 | const notificationBadge = document.querySelectorAll( |
5 | '.notification-badge', | 11 | '.notification-badge', |
6 | )[0]; | 12 | )[0]; |
7 | if (notificationBadge != undefined) { | 13 | if (notificationBadge !== undefined) { |
8 | unread = Ferdium.safeParseInt(notificationBadge.textContent); | 14 | unread = Ferdium.safeParseInt(notificationBadge.textContent); |
9 | } | 15 | } |
10 | Ferdium.setBadge(unread); | 16 | Ferdium.setBadge(unread); |
11 | }; | 17 | }; |
12 | 18 | ||
13 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 22 | }; |