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/teamleader/webview.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'recipes/teamleader') diff --git a/recipes/teamleader/webview.js b/recipes/teamleader/webview.js index 241d787..f846f55 100644 --- a/recipes/teamleader/webview.js +++ b/recipes/teamleader/webview.js @@ -1,26 +1,36 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { let notifications = 0; let indirectNotifications = 0; - const notification_element = document.getElementById('notifications_amount'); - const ticket_element = document.querySelector("a[href='tickets.php'] > span"); - const call_element = document.getElementById('queue_amount'); + const notification_element = document.querySelector( + '#notifications_amount', + ); + const ticket_element = document.querySelector( + "a[href='tickets.php'] > span", + ); + const call_element = document.querySelector('#queue_amount'); if (notification_element) { - notifications = Ferdi.safeParseInt(notification_element.getAttribute("datacount")); + notifications = Ferdi.safeParseInt( + notification_element.getAttribute('datacount'), + ); } if (ticket_element != null) { - indirectNotifications = Ferdi.safeParseInt(ticket_element.innerHTML); + indirectNotifications = Ferdi.safeParseInt(ticket_element.textContent); } if (call_element) { - indirectNotifications += Ferdi.safeParseInt(call_element.getAttribute("datacount")); + indirectNotifications += Ferdi.safeParseInt( + call_element.getAttribute('datacount'), + ); } Ferdi.setBadge(notifications, indirectNotifications); -- cgit v1.2.3-54-g00ecf