Skip to content

Commit

Permalink
Fix for badges on Teams V2 (new Teams) (#542)
Browse files Browse the repository at this point in the history
* Fix for badges on Teams V2 (new Teams)

* Update version
  • Loading branch information
SpecialAro authored May 4, 2024
1 parent dbee8e3 commit 4394365
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion recipes/msteams/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "msteams",
"name": "Microsoft Teams",
"version": "3.3.1",
"version": "3.3.2",
"license": "MIT",
"aliases": [
"teamsChat"
Expand Down
10 changes: 9 additions & 1 deletion recipes/msteams/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ const _path = _interopRequireDefault(require('path'));
module.exports = Ferdium => {
const getMessages = () => {
let messages = 0;
const badges = document.querySelectorAll(

const isTeamsV2 = window.location.href.includes('/v2/');

let badges = document.querySelectorAll(
'.activity-badge.dot-activity-badge .activity-badge',
);

if (isTeamsV2) {
badges = document.querySelectorAll('.fui-Badge');
}

if (badges) {
Array.prototype.forEach.call(badges, badge => {
messages += Ferdium.safeParseInt(badge.textContent);
Expand Down

0 comments on commit 4394365

Please sign in to comment.