diff options
-rw-r--r-- | recipes/slack/package.json | 2 | ||||
-rw-r--r-- | recipes/slack/webview.js | 17 |
2 files changed, 15 insertions, 4 deletions
diff --git a/recipes/slack/package.json b/recipes/slack/package.json index 99e3559..15138e6 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.5.0", | 4 | "version": "1.6.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 bd28ba9..f6b5af3 100644 --- a/recipes/slack/webview.js +++ b/recipes/slack/webview.js | |||
@@ -38,12 +38,23 @@ module.exports = Ferdium => { | |||
38 | const getTeamIcon = function getTeamIcon(count = 0) { | 38 | const getTeamIcon = function getTeamIcon(count = 0) { |
39 | let countTeamIconCheck = count; | 39 | let countTeamIconCheck = count; |
40 | let bgUrl = null; | 40 | let bgUrl = null; |
41 | const teamMenu = document.querySelector( | 41 | // INFO: A new Slack UI was introduced in August 2023 and will be rolled out gradually, |
42 | // therefore we need to support both old and new UI for the time being | ||
43 | // See more: https://slack.com/blog/productivity/a-redesigned-slack-built-for-focus | ||
44 | const oldSlackUiTeamMenu = document.querySelector( | ||
42 | '#team-menu-trigger, .p-ia__sidebar_header__team_name', | 45 | '#team-menu-trigger, .p-ia__sidebar_header__team_name', |
43 | ); | 46 | ); |
47 | const newSlackUiTeamMenu = document.querySelector( | ||
48 | '.p-ia4_home_header_menu__button', | ||
49 | ); | ||
50 | |||
51 | if (oldSlackUiTeamMenu || newSlackUiTeamMenu) { | ||
52 | if (oldSlackUiTeamMenu) { | ||
53 | oldSlackUiTeamMenu.click(); | ||
54 | } else if (newSlackUiTeamMenu) { | ||
55 | newSlackUiTeamMenu.click(); | ||
56 | } | ||
44 | 57 | ||
45 | if (teamMenu) { | ||
46 | teamMenu.click(); | ||
47 | const icon = document.querySelector('.c-team_icon'); | 58 | const icon = document.querySelector('.c-team_icon'); |
48 | 59 | ||
49 | if (icon) { | 60 | if (icon) { |