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/package.json | 2 +- recipes/circuit/webview.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'recipes') diff --git a/recipes/circuit/package.json b/recipes/circuit/package.json index a569472..1beaa12 100644 --- a/recipes/circuit/package.json +++ b/recipes/circuit/package.json @@ -1,7 +1,7 @@ { "id": "circuit", "name": "Circuit", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "config": { "serviceURL": "https://eu.yourcircuit.com/" 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-54-g00ecf