aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/stackoverflow-chat/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/stackoverflow-chat/webview.js')
-rw-r--r--recipes/stackoverflow-chat/webview.js10
1 files changed, 7 insertions, 3 deletions
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 @@
1var _path = _interopRequireDefault(require('path')); 1var _path = _interopRequireDefault(require('path'));
2 2
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
4 6
5module.exports = Ferdi => { 7module.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 };