-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 badge number on web #4562
Conversation
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.
Apart from that one comment looks good to me!
Could you please also add the |
Sure, will do it by end of next week since I am currently on vacation 😊 |
@sjchmiela I just implemented your suggestions. Anything else? 😊 |
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.
This looks OK to try for now but since a lot of the functionality is in the package if there are issues we might need to revert.
}, | ||
async setBadgeNumberAsync(badgeNumber: number): Promise<void> { | ||
currentBadgeNumber = badgeNumber | ||
badgin.set(badgeNumber) |
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.
Does this clear when set to zero?
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.
Yes, it does clear the badge if set to zero. I just released a new version that explicitly checks this case.
Co-Authored-By: James Ide <ide@users.noreply.github.com>
Co-Authored-By: James Ide <ide@users.noreply.github.com>
Co-Authored-By: James Ide <ide@users.noreply.github.com>
Looks good, just one more CI test that needs to pass:
|
Ah, I didn't know that the build files also need to be committed. Checking all the test results I think the PR is finally ready. As far as I could see the failed tests are not related to these changes. |
Why
Badge numbers were not supported on web so far.
How
This solution uses https://www.npmjs.com/package/@approvals-cloud/badgin which is a wrapper around the future Badging API that nicely falls back to the favicon or title.
Test Plan
Use
getBadgeNumberAsync
andsetBadgeNumberAsync
on web.