diff options
Diffstat (limited to 'recipes/wire/webview.js')
-rw-r--r-- | recipes/wire/webview.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/recipes/wire/webview.js b/recipes/wire/webview.js index efd37f3..b099eee 100644 --- a/recipes/wire/webview.js +++ b/recipes/wire/webview.js | |||
@@ -7,10 +7,7 @@ module.exports = (Ferdi) => { | |||
7 | const conversationElems = document.querySelectorAll('[data-uie-name="conversation-folder-badge"]'); | 7 | const conversationElems = document.querySelectorAll('[data-uie-name="conversation-folder-badge"]'); |
8 | if (conversationElems) { | 8 | if (conversationElems) { |
9 | for (const conversationElem of conversationElems) { | 9 | for (const conversationElem of conversationElems) { |
10 | const count = parseInt(conversationElem.innerText); | 10 | direct += Ferdi.safeParseInt(conversationElem.innerText); |
11 | if (count) { | ||
12 | direct += count; | ||
13 | } | ||
14 | } | 11 | } |
15 | } | 12 | } |
16 | 13 | ||
@@ -18,8 +15,8 @@ module.exports = (Ferdi) => { | |||
18 | const pendingElem = document.querySelector('[data-uie-name="item-pending-requests"]'); | 15 | const pendingElem = document.querySelector('[data-uie-name="item-pending-requests"]'); |
19 | if (pendingElem) { | 16 | if (pendingElem) { |
20 | const matches = pendingElem.innerText.match(/^([1-9][0-9]*)/); | 17 | const matches = pendingElem.innerText.match(/^([1-9][0-9]*)/); |
21 | if (matches && matches.length > 0) { | 18 | if (matches && matches.length > 1) { |
22 | indirect += parseInt(matches[1]); | 19 | indirect += Ferdi.safeParseInt(matches[1]); |
23 | } | 20 | } |
24 | } | 21 | } |
25 | 22 | ||