diff options
author | 2019-12-20 19:22:21 +0100 | |
---|---|---|
committer | 2019-12-20 19:22:21 +0100 | |
commit | a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4 (patch) | |
tree | fb19d5c6cb80005059b456e4ba7ce4710f388b5f /uncompressed/slack/webview.js | |
parent | #15 Add mastodon recipe (diff) | |
parent | Add Zimbra recipe (diff) | |
download | ferdium-recipes-a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4.tar.gz ferdium-recipes-a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4.tar.zst ferdium-recipes-a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4.zip |
Merge branch 'master' of https://github.com/getferdi/recipes
Diffstat (limited to 'uncompressed/slack/webview.js')
-rw-r--r-- | uncompressed/slack/webview.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/uncompressed/slack/webview.js b/uncompressed/slack/webview.js index 98c6136..174d81c 100644 --- a/uncompressed/slack/webview.js +++ b/uncompressed/slack/webview.js | |||
@@ -9,11 +9,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de | |||
9 | const getTeamIcon = function getTeamIcon(count = 0) { | 9 | const getTeamIcon = function getTeamIcon(count = 0) { |
10 | let countTeamIconCheck = count; | 10 | let countTeamIconCheck = count; |
11 | let bgUrl = null; | 11 | let bgUrl = null; |
12 | const teamMenu = document.querySelector('#team_menu'); | 12 | const teamMenu = document.querySelector('#team-menu-trigger'); |
13 | 13 | ||
14 | if (teamMenu) { | 14 | if (teamMenu) { |
15 | teamMenu.click(); | 15 | teamMenu.click(); |
16 | const icon = document.querySelector('.team_icon'); | 16 | const icon = document.querySelector('.c-team_icon'); |
17 | 17 | ||
18 | if (icon) { | 18 | if (icon) { |
19 | bgUrl = window.getComputedStyle(icon, null).getPropertyValue('background-image'); | 19 | bgUrl = window.getComputedStyle(icon, null).getPropertyValue('background-image'); |
@@ -22,8 +22,7 @@ const getTeamIcon = function getTeamIcon(count = 0) { | |||
22 | } | 22 | } |
23 | 23 | ||
24 | setTimeout(() => { | 24 | setTimeout(() => { |
25 | document.querySelector('.team_menu').remove(); | 25 | document.querySelector('.ReactModal__Overlay').click(); |
26 | document.querySelector('#msg_input .ql-editor').focus(); | ||
27 | }, 10); | 26 | }, 10); |
28 | } | 27 | } |
29 | 28 | ||
@@ -42,7 +41,7 @@ const SELECTOR_CHANNELS_UNREAD = '.p-channel_sidebar__channel--unread:not(.p-cha | |||
42 | 41 | ||
43 | module.exports = Franz => { | 42 | module.exports = Franz => { |
44 | const getMessages = () => { | 43 | const getMessages = () => { |
45 | const directMessages = document.querySelectorAll(`${SELECTOR_CHANNELS_UNREAD} .p-channel_sidebar__badge`).length; | 44 | const directMessages = document.querySelectorAll(`${SELECTOR_CHANNELS_UNREAD} .p-channel_sidebar__badge, .p-channel_sidebar__link--unread`).length; |
46 | const allMessages = document.querySelectorAll(SELECTOR_CHANNELS_UNREAD).length - directMessages; | 45 | const allMessages = document.querySelectorAll(SELECTOR_CHANNELS_UNREAD).length - directMessages; |
47 | Franz.setBadge(directMessages, allMessages); | 46 | Franz.setBadge(directMessages, allMessages); |
48 | }; | 47 | }; |