diff options
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js index be29142af..cae6c7dc4 100644 --- a/src/webview/lib/RecipeWebview.js +++ b/src/webview/lib/RecipeWebview.js | |||
@@ -39,9 +39,15 @@ class RecipeWebview { | |||
39 | if (this.countCache.direct === direct | 39 | if (this.countCache.direct === direct |
40 | && this.countCache.indirect === indirect) return; | 40 | && this.countCache.indirect === indirect) return; |
41 | 41 | ||
42 | // Parse number to integer | ||
43 | // This will correct errors that recipes may introduce, e.g. | ||
44 | // by sending a String instead of an integer | ||
45 | const directInt = parseInt(direct); | ||
46 | const indirectInt = parseInt(indirect); | ||
47 | |||
42 | const count = { | 48 | const count = { |
43 | direct: direct > 0 ? direct : 0, | 49 | direct: directInt > 0 ? directInt : 0, |
44 | indirect: indirect > 0 ? indirect : 0, | 50 | indirect: indirectInt > 0 ? indirectInt : 0, |
45 | }; | 51 | }; |
46 | 52 | ||
47 | ipcRenderer.sendToHost('messages', count); | 53 | ipcRenderer.sendToHost('messages', count); |