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/facebook/webview.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'recipes/facebook') diff --git a/recipes/facebook/webview.js b/recipes/facebook/webview.js index 43de149..b38a2fb 100755 --- a/recipes/facebook/webview.js +++ b/recipes/facebook/webview.js @@ -1,19 +1,21 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getNotifications = function getNotifications() { let count = 0; const elements = [ - document.getElementById('requestsCountValue'), + document.querySelector('#requestsCountValue'), // document.getElementById('mercurymessagesCountValue'), - document.getElementById('notificationsCountValue'), - document.querySelector('.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn'), + document.querySelector('#notificationsCountValue'), + document.querySelector( + '.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn', + ), ]; - elements.forEach((element) => { + for (const element of elements) { if (element !== null) { - count += Ferdi.safeParseInt(element.innerHTML); + count += Ferdi.safeParseInt(element.textContent); } - }); + } Ferdi.setBadge(count); }; -- cgit v1.2.3-54-g00ecf