aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/office365-owa/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/office365-owa/webview.js')
-rw-r--r--recipes/office365-owa/webview.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js
index ae21e19..6d4edf2 100644
--- a/recipes/office365-owa/webview.js
+++ b/recipes/office365-owa/webview.js
@@ -1,7 +1,7 @@
1'use strict'; 1'use strict';
2 2
3module.exports = Franz => { 3module.exports = Ferdi => {
4 const getMessages = function getMessages() { 4 function getMessages() {
5 let unreadMail = 0; 5 let unreadMail = 0;
6 6
7 if (location.pathname.match(/\/owa/)) { 7 if (location.pathname.match(/\/owa/)) {
@@ -14,12 +14,13 @@ module.exports = Franz => {
14 ); 14 );
15 } else { 15 } else {
16 // new app 16 // new app
17 const folders = document.querySelector('div[title="Folders"]'); 17 const favorites = document.querySelector('div[title="Favorites"]');
18 if (!folders) { 18 if (!favorites) {
19 return; 19 return;
20 } 20 }
21 const folders = Array.from(favorites.nextSibling.childNodes);
21 22
22 unreadMail = [...folders.parentNode.parentNode.children].reduce((count, child) => { 23 unreadMail = folders.reduce((count, child) => {
23 const unread = child.querySelector('.screenReaderOnly'); 24 const unread = child.querySelector('.screenReaderOnly');
24 return unread && unread.textContent === 'unread' 25 return unread && unread.textContent === 'unread'
25 ? count + parseInt(unread.previousSibling.textContent, 10) 26 ? count + parseInt(unread.previousSibling.textContent, 10)
@@ -27,7 +28,7 @@ module.exports = Franz => {
27 }, 0); 28 }, 0);
28 } 29 }
29 30
30 Franz.setBadge(unreadMail); 31 Ferdi.setBadge(unreadMail);
31 }; 32 };
32 Franz.loop(getMessages); 33 Ferdi.loop(getMessages);
33}; 34};