diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-05-28 20:00:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 20:00:37 +0200 |
commit | 9d863a62a4f33ed20ba8cc49ac0619d9599735c3 (patch) | |
tree | 7c0b30316f89decff8d5698b0449a5fba6e4228b /src/webview/lib | |
parent | Screen share refactoring (#1460) (diff) | |
download | ferdium-app-9d863a62a4f33ed20ba8cc49ac0619d9599735c3.tar.gz ferdium-app-9d863a62a4f33ed20ba8cc49ac0619d9599735c3.tar.zst ferdium-app-9d863a62a4f33ed20ba8cc49ac0619d9599735c3.zip |
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
Diffstat (limited to 'src/webview/lib')
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 6 |
1 files changed, 3 insertions, 3 deletions
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 { | |||
55 | const indirectInt = parseInt(indirect, 10); | 55 | const indirectInt = parseInt(indirect, 10); |
56 | 56 | ||
57 | const count = { | 57 | const count = { |
58 | direct: directInt > 0 ? directInt : 0, | 58 | direct: Math.max(directInt, 0), |
59 | indirect: indirectInt > 0 ? indirectInt : 0, | 59 | indirect: Math.max(indirectInt, 0), |
60 | }; | 60 | }; |
61 | 61 | ||
62 | 62 | ||
63 | ipcRenderer.sendToHost('messages', count); | 63 | ipcRenderer.sendToHost('message-counts', count); |
64 | Object.assign(this.countCache, count); | 64 | Object.assign(this.countCache, count); |
65 | 65 | ||
66 | debug('Sending badge count to host', count); | 66 | debug('Sending badge count to host', count); |