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/workplace/webview.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'recipes/workplace') diff --git a/recipes/workplace/webview.js b/recipes/workplace/webview.js index efa5e2a..90c6c27 100644 --- a/recipes/workplace/webview.js +++ b/recipes/workplace/webview.js @@ -1,6 +1,8 @@ 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 => { const getMessages = () => { @@ -10,7 +12,7 @@ module.exports = Ferdi => { const notifications = document.querySelector('#notifications span span'); if (notifications) { - indirect = Ferdi.safeParseInt(notifications.innerText); + indirect = Ferdi.safeParseInt(notifications.textContent); } if (chatsElement) { @@ -18,10 +20,12 @@ module.exports = Ferdi => { const chatMessages = chatsElement.querySelector('span'); if (chatMessages) { - direct = Ferdi.safeParseInt(chatMessages.innerText); + direct = Ferdi.safeParseInt(chatMessages.textContent); } } else { - direct = document.querySelectorAll('[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw').length; + direct = document.querySelectorAll( + '[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw', + ).length; } } @@ -33,18 +37,21 @@ module.exports = Ferdi => { Ferdi.injectCSS(_path.default.join(__dirname, 'workplace.css')); localStorage._cs_desktopNotifsEnabled = JSON.stringify({ - __t: new Date().getTime(), + __t: Date.now(), __v: true, }); if (typeof Ferdi.onNotify === 'function') { Ferdi.onNotify(notification => { if (typeof notification.title !== 'string') { - notification.title = ((notification.title.props || {}).content || [])[0] || 'Work Chat'; + notification.title = + ((notification.title.props || {}).content || [])[0] || 'Work Chat'; } if (typeof notification.options.body !== 'string') { - notification.options.body = (((notification.options.body || {}).props || {}).content || [])[0] || ''; + notification.options.body = + (((notification.options.body || {}).props || {}).content || [])[0] || + ''; } return notification; -- cgit v1.2.3-70-g09d2