diff options
Diffstat (limited to 'recipes/proton-mail')
-rw-r--r-- | recipes/proton-mail/webview.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/recipes/proton-mail/webview.js b/recipes/proton-mail/webview.js index 3d8a30e..fd1a865 100644 --- a/recipes/proton-mail/webview.js +++ b/recipes/proton-mail/webview.js | |||
@@ -1,16 +1,16 @@ | |||
1 | module.exports = Franz => { | 1 | module.exports = Franz => { |
2 | function getMessages() { | 2 | function getMessages() { |
3 | const element = document.querySelector('.navigationItem-counter') | 3 | const element = document.querySelector('.navigationItem-counter'); |
4 | if (!element) { | 4 | if (!element) { |
5 | return | 5 | return; |
6 | } | ||
7 | const text = element.innerText | ||
8 | const count = Number(text.substring(1, text.length - 1)) | ||
9 | if (Number.isNaN(count)) { | ||
10 | return | ||
11 | } | ||
12 | Franz.setBadge(count) | ||
13 | } | 6 | } |
7 | const text = element.innerText; | ||
8 | const count = Number(text.substring(1, text.length - 1)); | ||
9 | if (Number.isNaN(count)) { | ||
10 | return; | ||
11 | } | ||
12 | Franz.setBadge(count); | ||
13 | } | ||
14 | 14 | ||
15 | Franz.loop(getMessages) | 15 | Franz.loop(getMessages); |
16 | } | 16 | }; |