aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/threema
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-10-05 17:04:09 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-05 17:04:09 +0200
commitd3841b766f9d37d557646003899f67525c5f755f (patch)
tree1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/threema
parentchore: repo maintenance (#732) (diff)
downloadferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/threema')
-rw-r--r--recipes/threema/webview.js16
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 @@
1const _path = _interopRequireDefault(require('path')); 1const _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 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