diff options
Diffstat (limited to 'recipes/threema')
-rw-r--r-- | recipes/threema/webview.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/recipes/threema/webview.js b/recipes/threema/webview.js index 40f5203..cf7d1e1 100644 --- a/recipes/threema/webview.js +++ b/recipes/threema/webview.js | |||
@@ -1,17 +1,21 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | const _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 elements = document.querySelectorAll('.badge.unread-count:not(.ng-hide)'); | 9 | const elements = document.querySelectorAll( |
10 | '.badge.unread-count:not(.ng-hide)', | ||
11 | ); | ||
8 | let count = 0; | 12 | let count = 0; |
9 | 13 | ||
10 | for (let i = 0; i < elements.length; i += 1) { | 14 | for (const element of elements) { |
11 | try { | 15 | try { |
12 | count += Ferdi.safeParseInt(elements[i].innerHTML); | 16 | count += Ferdi.safeParseInt(element.textContent); |
13 | } catch (e) { | 17 | } catch (error) { |
14 | console.error(e); | 18 | console.error(error); |
15 | } | 19 | } |
16 | } | 20 | } |
17 | 21 | ||