aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/slack/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/slack/webview.js')
-rw-r--r--recipes/slack/webview.js10
1 files changed, 6 insertions, 4 deletions
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) {
37 37
38const SELECTOR_CHANNELS_UNREAD = '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)'; 38const SELECTOR_CHANNELS_UNREAD = '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)';
39 39
40module.exports = Franz => { 40module.exports = Ferdi => {
41 const getMessages = () => { 41 const getMessages = () => {
42 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; 42 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;
43 const allMessages = document.querySelectorAll(SELECTOR_CHANNELS_UNREAD).length - directMessages; 43 const allMessages = document.querySelectorAll(SELECTOR_CHANNELS_UNREAD).length - directMessages;
44 Franz.setBadge(directMessages, allMessages); 44 Ferdi.setBadge(directMessages, allMessages);
45 }; 45 };
46 46
47 Franz.loop(getMessages); 47 Ferdi.loop(getMessages);
48
48 setTimeout(() => { 49 setTimeout(() => {
49 getTeamIcon(); 50 getTeamIcon();
50 }, 4000); 51 }, 4000);
51 Franz.injectCSS(_path.default.join(__dirname, 'service.css')); 52
53 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));
52}; 54};