aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/slack/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-27 18:13:24 +0530
committerLibravatar GitHub <noreply@github.com>2021-08-27 18:13:24 +0530
commit155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch)
treed144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/slack/webview.js
parentdocs: fixed template file for creating recipe. (diff)
downloadferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.gz
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.zst
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.zip
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.
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};