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

Fix for badges on Teams V2 (new Teams) #542

Merged
merged 2 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading