diff options
Diffstat (limited to 'recipes/office365-owa/webview.js')
-rw-r--r-- | recipes/office365-owa/webview.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js index 70790f0..9613636 100644 --- a/recipes/office365-owa/webview.js +++ b/recipes/office365-owa/webview.js | |||
@@ -18,12 +18,10 @@ module.exports = (Ferdium, settings) => { | |||
18 | const getMessages = () => { | 18 | const getMessages = () => { |
19 | let directUnreadCount = 0; | 19 | let directUnreadCount = 0; |
20 | let indirectUnreadCount = 0; | 20 | let indirectUnreadCount = 0; |
21 | |||
22 | if (/\/owa/.test(location.pathname)) { | 21 | if (/\/owa/.test(location.pathname)) { |
23 | // classic app | 22 | // classic app |
24 | directUnreadCount = Ferdium.safeParseInt( | 23 | directUnreadCount = Ferdium.safeParseInt( |
25 | document.querySelectorAll("span[title*='Inbox'] + div > span")[0] | 24 | document.querySelectorAll("span[title*='Inbox'] + div > span")[0]?.textContent |
26 | .textContent, | ||
27 | ); | 25 | ); |
28 | } else { | 26 | } else { |
29 | // new app | 27 | // new app |
@@ -37,6 +35,5 @@ module.exports = (Ferdium, settings) => { | |||
37 | 35 | ||
38 | Ferdium.setBadge(directUnreadCount, indirectUnreadCount); | 36 | Ferdium.setBadge(directUnreadCount, indirectUnreadCount); |
39 | }; | 37 | }; |
40 | |||
41 | Ferdium.loop(getMessages); | 38 | Ferdium.loop(getMessages); |
42 | }; | 39 | }; |