From d3841b766f9d37d557646003899f67525c5f755f Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 5 Oct 2021 17:04:09 +0200 Subject: chore: add eslint-plugin-unicorn (#733) --- recipes/guilded/webview.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'recipes/guilded/webview.js') 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 @@ module.exports = Ferdi => { const getMessages = () => { let unread = 0; - const notificationBadge = document.getElementsByClassName('NavSelectorItem-unread-badge')[0]; + const notificationBadge = document.querySelectorAll( + '.NavSelectorItem-unread-badge', + )[0]; if (notificationBadge != undefined) { - const innerBadge = notificationBadge.getElementsByClassName('BadgeV2-count')[0]; - unread = Ferdi.safeParseInt(innerBadge.innerText); + const innerBadge = + notificationBadge.querySelectorAll('.BadgeV2-count')[0]; + unread = Ferdi.safeParseInt(innerBadge.textContent); } Ferdi.setBadge(unread); }; -- cgit v1.2.3-54-g00ecf