From aa244f76cb03f9e10e3657503abb1bf5f6475fbb Mon Sep 17 00:00:00 2001 From: Edmundo Sanchez Date: Mon, 17 Oct 2022 09:49:41 -0500 Subject: Fix: Unread count stays at 1 when all emails are read (#178) - Element that contains the unread count dissapears when count is zero. - Added that scenario to reset th ecount to zero and send it to the badge Co-authored-by: Vijay A --- recipes/onmail/package.json | 2 +- recipes/onmail/webview.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'recipes/onmail') diff --git a/recipes/onmail/package.json b/recipes/onmail/package.json index 70b7e11..fd48d51 100644 --- a/recipes/onmail/package.json +++ b/recipes/onmail/package.json @@ -1,7 +1,7 @@ { "id": "onmail", "name": "onMail", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "config": { "serviceURL": "https://mail.onmail.com" diff --git a/recipes/onmail/webview.js b/recipes/onmail/webview.js index 8565d76..9e881f4 100644 --- a/recipes/onmail/webview.js +++ b/recipes/onmail/webview.js @@ -10,7 +10,9 @@ module.exports = Ferdium => { const inboxLinks = document.querySelectorAll('p.truncate'); for (const label of inboxLinks){ if (label.textContent) { - countImportant = Ferdium.safeParseInt(label.nextSibling.textContent); + let inbox_count = label.nextSibling + countImportant = inbox_count == null ? 0 : Ferdium.safeParseInt(inbox_count.textContent); + break; } } -- cgit v1.2.3-54-g00ecf