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/scrumpy/webview.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'recipes/scrumpy/webview.js') diff --git a/recipes/scrumpy/webview.js b/recipes/scrumpy/webview.js index 5c762e4..46f6424 100644 --- a/recipes/scrumpy/webview.js +++ b/recipes/scrumpy/webview.js @@ -1,8 +1,12 @@ module.exports = Ferdi => { const getMessages = () => { - const notifications = document.querySelector('.c-notifications-dropdown__count') - Ferdi.setBadge(notifications.innerText); - }; + const notifications = document.querySelector( + '.c-notifications-dropdown__count', + ); + if (notifications) { + Ferdi.setBadge(notifications.textContent); + } + }; - Ferdi.loop(getMessages); + Ferdi.loop(getMessages); }; -- cgit v1.2.3-70-g09d2