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/twitter/webview.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'recipes/twitter/webview.js') diff --git a/recipes/twitter/webview.js b/recipes/twitter/webview.js index dfd06d1..d88e3e4 100644 --- a/recipes/twitter/webview.js +++ b/recipes/twitter/webview.js @@ -4,13 +4,17 @@ module.exports = Ferdi => { // "Notifications" and "Messages" - aria-label ending in // "unread items". Sum the values for direct badge. - const notificationsElement = document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div'); + const notificationsElement = document.querySelector( + '[data-testid=AppTabBar_Notifications_Link] div div div', + ); if (notificationsElement) { - direct += Ferdi.safeParseInt(notificationsElement.innerHTML); + direct += Ferdi.safeParseInt(notificationsElement.textContent); } - const DMElement = document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div'); + const DMElement = document.querySelector( + '[data-testid=AppTabBar_DirectMessage_Link] div div div', + ); if (DMElement) { - direct += Ferdi.safeParseInt(DMElement.innerHTML); + direct += Ferdi.safeParseInt(DMElement.textContent); } Ferdi.setBadge(direct); -- cgit v1.2.3-70-g09d2