From 155c4b832281348c16be1f4ef667e6e23dbf1bd8 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Fri, 27 Aug 2021 18:13:24 +0530 Subject: chore: normalized all recipes to ensure compatibility with es6 (#639) - Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm. --- recipes/slack/webview.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'recipes/slack/webview.js') diff --git a/recipes/slack/webview.js b/recipes/slack/webview.js index f0eb265..b8e3817 100644 --- a/recipes/slack/webview.js +++ b/recipes/slack/webview.js @@ -37,16 +37,18 @@ const getTeamIcon = function getTeamIcon(count = 0) { const SELECTOR_CHANNELS_UNREAD = '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)'; -module.exports = Franz => { +module.exports = Ferdi => { const getMessages = () => { const directMessages = document.querySelectorAll(`${SELECTOR_CHANNELS_UNREAD} .p-channel_sidebar__badge, .p-channel_sidebar__link--unread:not([data-sidebar-link-id="Punreads"]):not([data-sidebar-link-id="Pdrafts"]):not([data-sidebar-link-id="Pdms"])`).length; const allMessages = document.querySelectorAll(SELECTOR_CHANNELS_UNREAD).length - directMessages; - Franz.setBadge(directMessages, allMessages); + Ferdi.setBadge(directMessages, allMessages); }; - Franz.loop(getMessages); + Ferdi.loop(getMessages); + setTimeout(() => { getTeamIcon(); }, 4000); - Franz.injectCSS(_path.default.join(__dirname, 'service.css')); + + Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); }; -- cgit v1.2.3-70-g09d2