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/erepublik/index.js | 3 +-- recipes/erepublik/webview.js | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'recipes/erepublik') diff --git a/recipes/erepublik/index.js b/recipes/erepublik/index.js index 146e5fb..12cdd73 100644 --- a/recipes/erepublik/index.js +++ b/recipes/erepublik/index.js @@ -1,2 +1 @@ -module.exports = Ferdi => class erepublik extends Ferdi { -}; +module.exports = Ferdi => class erepublik extends Ferdi {}; diff --git a/recipes/erepublik/webview.js b/recipes/erepublik/webview.js index 6a105e1..a47c57d 100644 --- a/recipes/erepublik/webview.js +++ b/recipes/erepublik/webview.js @@ -4,19 +4,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de module.exports = Ferdi => { const getMessages = () => { - const elementNotify = document.getElementsByClassName('notify'); - const elementFeed = document.getElementsByClassName('unreadCounter ng-binding ng-scope'); + const elementNotify = document.querySelectorAll('.notify'); + const elementFeed = document.querySelectorAll('.unreadCounter.ng-binding.ng-scope'); let countNotify = 0; let countFeed = 0; - for (let i = 0; i < elementNotify.length; i++) { - const splitText = elementNotify[i].title.split(':'); + for (const element of elementNotify) { + const splitText = element.title.split(':'); countNotify += Ferdi.safeParseInt(splitText[1]); } - for (let i = 0; i < elementFeed.length; i++) { - countFeed += Ferdi.safeParseInt(elementFeed[i].textContent); + for (const element of elementFeed) { + countFeed += Ferdi.safeParseInt(element.textContent); } Ferdi.setBadge(countNotify, countFeed); -- cgit v1.2.3-70-g09d2