diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-05 17:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 17:04:09 +0200 |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/nextdoor/webview.js | |
parent | chore: repo maintenance (#732) (diff) | |
download | ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip |
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/nextdoor/webview.js')
-rw-r--r-- | recipes/nextdoor/webview.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/recipes/nextdoor/webview.js b/recipes/nextdoor/webview.js index 503d9a4..809e368 100644 --- a/recipes/nextdoor/webview.js +++ b/recipes/nextdoor/webview.js | |||
@@ -1,9 +1,11 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let unread = 0; | 3 | let unread = 0; |
4 | const notificationBadge = document.getElementsByClassName('notification-badge')[0]; | 4 | const notificationBadge = document.querySelectorAll( |
5 | '.notification-badge', | ||
6 | )[0]; | ||
5 | if (notificationBadge != undefined) { | 7 | if (notificationBadge != undefined) { |
6 | unread = Ferdi.safeParseInt(notificationBadge.innerText); | 8 | unread = Ferdi.safeParseInt(notificationBadge.textContent); |
7 | } | 9 | } |
8 | Ferdi.setBadge(unread); | 10 | Ferdi.setBadge(unread); |
9 | }; | 11 | }; |