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/guilded | |
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/guilded')
-rw-r--r-- | recipes/guilded/webview.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/recipes/guilded/webview.js b/recipes/guilded/webview.js index c8d33f2..69c3bcb 100644 --- a/recipes/guilded/webview.js +++ b/recipes/guilded/webview.js | |||
@@ -1,10 +1,13 @@ | |||
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('NavSelectorItem-unread-badge')[0]; | 4 | const notificationBadge = document.querySelectorAll( |
5 | '.NavSelectorItem-unread-badge', | ||
6 | )[0]; | ||
5 | if (notificationBadge != undefined) { | 7 | if (notificationBadge != undefined) { |
6 | const innerBadge = notificationBadge.getElementsByClassName('BadgeV2-count')[0]; | 8 | const innerBadge = |
7 | unread = Ferdi.safeParseInt(innerBadge.innerText); | 9 | notificationBadge.querySelectorAll('.BadgeV2-count')[0]; |
10 | unread = Ferdi.safeParseInt(innerBadge.textContent); | ||
8 | } | 11 | } |
9 | Ferdi.setBadge(unread); | 12 | Ferdi.setBadge(unread); |
10 | }; | 13 | }; |