From 9d863a62a4f33ed20ba8cc49ac0619d9599735c3 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 28 May 2021 20:00:37 +0200 Subject: Clean up RecipeWebview.setBadge (#1461) Extracted from 240c3a72363e7388779c9ed3c6467ec63bb64d94 according to https://github.com/getferdi/ferdi/pull/1456#discussion_r641182688 and https://github.com/getferdi/ferdi/pull/1456#discussion_r641183662 --- src/webview/lib/RecipeWebview.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/webview') diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js index bb2052107..bef4b78ef 100644 --- a/src/webview/lib/RecipeWebview.js +++ b/src/webview/lib/RecipeWebview.js @@ -55,12 +55,12 @@ class RecipeWebview { const indirectInt = parseInt(indirect, 10); const count = { - direct: directInt > 0 ? directInt : 0, - indirect: indirectInt > 0 ? indirectInt : 0, + direct: Math.max(directInt, 0), + indirect: Math.max(indirectInt, 0), }; - ipcRenderer.sendToHost('messages', count); + ipcRenderer.sendToHost('message-counts', count); Object.assign(this.countCache, count); debug('Sending badge count to host', count); -- cgit v1.2.3-70-g09d2