diff options
Diffstat (limited to 'recipes/slack')
-rw-r--r-- | recipes/slack/index.js | 2 | ||||
-rw-r--r-- | recipes/slack/package.json | 2 | ||||
-rw-r--r-- | recipes/slack/webview.js | 10 |
3 files changed, 8 insertions, 6 deletions
diff --git a/recipes/slack/index.js b/recipes/slack/index.js index 258da41..23607bd 100644 --- a/recipes/slack/index.js +++ b/recipes/slack/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Franz => Franz; | module.exports = Ferdi => Ferdi; | ||
diff --git a/recipes/slack/package.json b/recipes/slack/package.json index 1a4e1ad..1c5de53 100644 --- a/recipes/slack/package.json +++ b/recipes/slack/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "slack", | 2 | "id": "slack", |
3 | "name": "Slack", | 3 | "name": "Slack", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.slack.com", | 7 | "serviceURL": "https://{teamId}.slack.com", |
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 | ||
38 | const SELECTOR_CHANNELS_UNREAD = '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)'; | 38 | const SELECTOR_CHANNELS_UNREAD = '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)'; |
39 | 39 | ||
40 | module.exports = Franz => { | 40 | module.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 | }; |