diff options
Diffstat (limited to 'recipes/guilded/webview.js')
-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 | }; |