diff options
Diffstat (limited to 'recipes/stackoverflow-chat')
-rw-r--r-- | recipes/stackoverflow-chat/index.js | 3 | ||||
-rw-r--r-- | recipes/stackoverflow-chat/webview.js | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/recipes/stackoverflow-chat/index.js b/recipes/stackoverflow-chat/index.js index c6cfcdf..ea29aa3 100644 --- a/recipes/stackoverflow-chat/index.js +++ b/recipes/stackoverflow-chat/index.js | |||
@@ -1,2 +1 @@ | |||
1 | module.exports = Ferdi => class stackoverflowchat extends Ferdi { | module.exports = Ferdi => class stackoverflowchat extends Ferdi {}; | |
2 | }; | ||
diff --git a/recipes/stackoverflow-chat/webview.js b/recipes/stackoverflow-chat/webview.js index cf487b5..4157600 100644 --- a/recipes/stackoverflow-chat/webview.js +++ b/recipes/stackoverflow-chat/webview.js | |||
@@ -1,13 +1,17 @@ | |||
1 | var _path = _interopRequireDefault(require('path')); | 1 | var _path = _interopRequireDefault(require('path')); |
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
4 | 6 | ||
5 | module.exports = Ferdi => { | 7 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const unreadSpan = document.querySelector('span.flag-count.message-count.unread-count'); | 9 | const unreadSpan = document.querySelector( |
10 | 'span.flag-count.message-count.unread-count', | ||
11 | ); | ||
8 | let directCount = 0; | 12 | let directCount = 0; |
9 | if (unreadSpan) { | 13 | if (unreadSpan) { |
10 | directCount = Ferdi.safeParseInt(unreadSpan.innerText); | 14 | directCount = Ferdi.safeParseInt(unreadSpan.textContent); |
11 | } | 15 | } |
12 | Ferdi.setBadge(directCount); | 16 | Ferdi.setBadge(directCount); |
13 | }; | 17 | }; |