aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/slack
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-09-25 16:56:14 -0600
committerLibravatar GitHub <noreply@github.com>2023-09-25 16:56:14 -0600
commit9bfc14a932bd266bc61d72b03fc844561254df6a (patch)
treeb1007076c149fbfb45b7fae3c8d50ae1fa6885c9 /recipes/slack
parentAdd new steamchat recipe icon. (#429) (diff)
downloadferdium-recipes-9bfc14a932bd266bc61d72b03fc844561254df6a.tar.gz
ferdium-recipes-9bfc14a932bd266bc61d72b03fc844561254df6a.tar.zst
ferdium-recipes-9bfc14a932bd266bc61d72b03fc844561254df6a.zip
feat: support for the new slack ui (#425)
- update selector for team menu to work with new and old slack ui - bump slack recipe to v1.6.0
Diffstat (limited to 'recipes/slack')
-rw-r--r--recipes/slack/package.json2
-rw-r--r--recipes/slack/webview.js17
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) {