aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/proton-mail/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/proton-mail/webview.js')
-rw-r--r--recipes/proton-mail/webview.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/recipes/proton-mail/webview.js b/recipes/proton-mail/webview.js
index ed66db5..395b779 100644
--- a/recipes/proton-mail/webview.js
+++ b/recipes/proton-mail/webview.js
@@ -4,10 +4,13 @@ module.exports = Ferdi => {
4 if (!element) { 4 if (!element) {
5 return; 5 return;
6 } 6 }
7 const text = element.innerText; 7 const text = element.textContent;
8 const count = Ferdi.safeParseInt(text.substring(1, text.length - 1)); 8 if (text) {
9 Ferdi.setBadge(count); 9 // eslint-disable-next-line unicorn/prefer-string-slice
10 } 10 const count = Ferdi.safeParseInt(text.substring(1, text.length - 1));
11 Ferdi.setBadge(count);
12 }
13 };
11 14
12 Ferdi.loop(getMessages); 15 Ferdi.loop(getMessages);
13}; 16};