From 63cea1d022e5aa2b0fa050ea346b4684a959a9ca Mon Sep 17 00:00:00 2001 From: Simon Szustkowski Date: Mon, 29 Nov 2021 10:54:36 +0100 Subject: Fixed unread badge for circuit (#777) --- recipes/circuit/webview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'recipes/circuit/webview.js') diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js index ce74eef..b5e3fd5 100644 --- a/recipes/circuit/webview.js +++ b/recipes/circuit/webview.js @@ -8,8 +8,10 @@ module.exports = Ferdi => { const titleValue = document.querySelector('title').text; // Extract the number from the tag match = titleValue.match(/\d+/); + unread = match != null && match.length > 0 ? match[0] : 0; // Set unread msgs badge - Ferdi.setBadge(Ferdi.safeParseInt(match[0])); + + Ferdi.setBadge(Ferdi.safeParseInt(unread)); }; const loopFunc = () => { -- cgit v1.2.3-70-g09d2