-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support for the new slack ui #425
feat: support for the new slack ui #425
Conversation
const oldSlackUiTeamMenu = document.querySelector( | ||
'#team-menu-trigger, .p-ia__sidebar_header__team_name', | ||
); | ||
const newSlackUiTeamMenu = document.querySelector( | ||
'.p-ia4_home_header_menu__button', | ||
); | ||
|
||
if (oldSlackUiTeamMenu || newSlackUiTeamMenu) { | ||
if (oldSlackUiTeamMenu) { | ||
oldSlackUiTeamMenu.click(); | ||
} else if (newSlackUiTeamMenu) { | ||
newSlackUiTeamMenu.click(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it (I don't use slack). But instead of this, can't we use an array of strings on which we pass all the query selectors (old and new)? Given that the logic for both new and old just vary on the query selector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how that would look like, feel free to push a commit simplifying this!
I wasn't planning on keeping this code around for the long run and remove the old slack UI code in a couple of months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets go with your fix and then change it in a couple of months (when the new UI sticks) 😄 Thank you!
- update selector for team menu to work with new and old slack ui - bump slack recipe to v1.6.0
f406bc0
to
63645c3
Compare
Pre-flight Checklist
Please ensure you've completed all of the following.
Description of Change
References ferdium/ferdium-app#1371
Screenshots
Slack service has the icon again: