From 44ab1963c2ae4de1a7848aed25ca82377b772a97 Mon Sep 17 00:00:00 2001 From: Jijo Joseph Date: Sun, 7 Apr 2024 00:23:31 +0530 Subject: [PATCH] Fixed notification badge count does not clear when none pending --- app/browser/tools/mutationTitle.js | 10 ++++------ package.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/browser/tools/mutationTitle.js b/app/browser/tools/mutationTitle.js index e36c580..1994656 100644 --- a/app/browser/tools/mutationTitle.js +++ b/app/browser/tools/mutationTitle.js @@ -15,12 +15,10 @@ class MutationObserverTitle { console.log(window.document.title); const regex = /^\((\d+)\)/; const match = window.document.title.match(regex); - if (match) { - const number = match[1]; - console.log(number); - const event = new CustomEvent('unread-count', { detail: { number: number } }); - window.dispatchEvent(event); - } + const number = match ? match[1] : 0; + console.log(number); + const event = new CustomEvent('unread-count', { detail: { number: number } }); + window.dispatchEvent(event); } ); observer.observe(window.document.querySelector('title'),{ childList: true }); diff --git a/package.json b/package.json index 95800a1..f69cc8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teams-for-linux", - "version": "1.4.19", + "version": "1.4.20", "main": "app/index.js", "description": "Unofficial client for Microsoft Teams for Linux", "homepage": "https://github.com/IsmaelMartinez/teams-for-linux",