Skip to content
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

Add badge count support to AirMessage recipe #367

Closed
wants to merge 1 commit into from

Conversation

cloopadoop
Copy link
Contributor

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

  • Updated service icon
  • Cycle through applicable DOM elements and check for bold font weight, which indicates unread messages in a thread

@cloopadoop
Copy link
Contributor Author

(By the way, Contributing Guidelines file is gone!)

Copy link
Member

@Alphrag Alphrag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not using this service so I cannot verify if this will work appropriately. However, I think that relying on the font weight of elements is prone to break and I would recommend finding a more robust approach for the future. If this still works and you think that is at the moment the best way, I will be fine with it though.

On another note, please make sure to run the tests as described there before you push the next changes, and this should be done before submitting a PR as well so that linting and errors are caught as early as possible.

let count = 0;
let messageNameElements = document.getElementsByClassName("MuiTypography-body1");
if (messageNameElements.length > 0) {
for (i = 0; i < messageNameElements.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix this for loop. I would suggest making it more robust by using the automatic loops (in the like of for (var element of messageNameElements) which makes the test on the previous line unnecessary as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants