diff --git a/recipes/office365-owa/package.json b/recipes/office365-owa/package.json index edba1c697..cbd975054 100644 --- a/recipes/office365-owa/package.json +++ b/recipes/office365-owa/package.json @@ -1,7 +1,7 @@ { "id": "office365-owa", "name": "Office 365 Outlook", - "version": "1.7.3", + "version": "1.7.4", "license": "MIT", "aliases": [ "live.com", diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js index 8deff398d..1d8c37e7c 100644 --- a/recipes/office365-owa/webview.js +++ b/recipes/office365-owa/webview.js @@ -5,12 +5,12 @@ function _interopRequireDefault(obj) { const _path = _interopRequireDefault(require('path')); module.exports = (Ferdium, settings) => { - const collectCounts = selector => { + const collectCounts = (selector, index=0) => { let unreadCount = 0; - const foldersElement = document.querySelector(selector); + const foldersElement = document.querySelectorAll(selector)[index]; if (foldersElement) { const allScreenReaders = foldersElement.querySelectorAll( - 'span.screenReaderOnly', + 'div[role=treeitem] > span:last-child span.screenReaderOnly' ); for (const child of allScreenReaders) { if (child.previousSibling) { @@ -36,8 +36,8 @@ module.exports = (Ferdium, settings) => { // new app directUnreadCount = settings.onlyShowFavoritesInUnreadCount === true - ? collectCounts('div[role=tree]:nth-child(2)') - : collectCounts('div[role=tree]:nth-child(1)'); + ? collectCounts('div[role=tree]', 0) + : collectCounts('div[role=tree]', 1); indirectUnreadCount = collectCounts('div[role=tree]:nth-child(4)'); // groups }