diff options
author | 2021-10-15 09:48:06 +0200 | |
---|---|---|
committer | 2021-10-15 09:48:06 +0200 | |
commit | 14d2364fc69e0222133115c55a36286986006098 (patch) | |
tree | 9e9b3c41ef742bbe87ca1632b292c67043051957 /src/webview/badge.ts | |
parent | 5.6.3-nightly.34 [skip ci] (diff) | |
download | ferdium-app-14d2364fc69e0222133115c55a36286986006098.tar.gz ferdium-app-14d2364fc69e0222133115c55a36286986006098.tar.zst ferdium-app-14d2364fc69e0222133115c55a36286986006098.zip |
chore: update eslint setup (#2074)
Diffstat (limited to 'src/webview/badge.ts')
-rw-r--r-- | src/webview/badge.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/webview/badge.ts b/src/webview/badge.ts index 8e8b66c0c..fb696723d 100644 --- a/src/webview/badge.ts +++ b/src/webview/badge.ts | |||
@@ -3,7 +3,7 @@ import { ipcRenderer } from 'electron'; | |||
3 | const debug = require('debug')('Ferdi:Plugin:BadgeHandler'); | 3 | const debug = require('debug')('Ferdi:Plugin:BadgeHandler'); |
4 | 4 | ||
5 | export class BadgeHandler { | 5 | export class BadgeHandler { |
6 | countCache: { direct: number; indirect: number; }; | 6 | countCache: { direct: number; indirect: number }; |
7 | 7 | ||
8 | constructor() { | 8 | constructor() { |
9 | this.countCache = { | 9 | this.countCache = { |
@@ -26,14 +26,19 @@ export class BadgeHandler { | |||
26 | return Math.max(adjustedNumber, 0); | 26 | return Math.max(adjustedNumber, 0); |
27 | } | 27 | } |
28 | 28 | ||
29 | setBadge(direct: string | number | undefined | null, indirect: string | number | undefined | null) { | 29 | setBadge( |
30 | direct: string | number | undefined | null, | ||
31 | indirect: string | number | undefined | null, | ||
32 | ) { | ||
30 | const count = { | 33 | const count = { |
31 | direct: this.safeParseInt(direct), | 34 | direct: this.safeParseInt(direct), |
32 | indirect: this.safeParseInt(indirect), | 35 | indirect: this.safeParseInt(indirect), |
33 | }; | 36 | }; |
34 | 37 | ||
35 | if (this.countCache.direct.toString() === count.direct.toString() | 38 | if ( |
36 | && this.countCache.indirect.toString() === count.indirect.toString()) { | 39 | this.countCache.direct.toString() === count.direct.toString() && |
40 | this.countCache.indirect.toString() === count.indirect.toString() | ||
41 | ) { | ||
37 | return; | 42 | return; |
38 | } | 43 | } |
39 | 44 | ||