diff options
Diffstat (limited to 'recipes/notion/webview.js')
-rw-r--r-- | recipes/notion/webview.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/recipes/notion/webview.js b/recipes/notion/webview.js index cd8f566..b209e75 100644 --- a/recipes/notion/webview.js +++ b/recipes/notion/webview.js | |||
@@ -1,13 +1,15 @@ | |||
1 | module.exports = (Ferdi) => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let direct = 0; | 3 | let direct = 0; |
4 | const badgeDiv = document.querySelector('.notion-sidebar-container > div > div > div > :nth-child(4) > :nth-child(2) > div > :nth-child(3) > div > div'); | 4 | const badgeDiv = document.querySelector( |
5 | '.notion-sidebar-container > div > div > div > :nth-child(4) > :nth-child(2) > div > :nth-child(3) > div > div', | ||
6 | ); | ||
5 | if (badgeDiv) { | 7 | if (badgeDiv) { |
6 | direct = Ferdi.safeParseInt(badgeDiv.innerText); | 8 | direct = Ferdi.safeParseInt(badgeDiv.textContent); |
7 | } | 9 | } |
8 | 10 | ||
9 | Ferdi.setBadge(direct); | 11 | Ferdi.setBadge(direct); |
10 | } | 12 | }; |
11 | 13 | ||
12 | Ferdi.loop(getMessages); | 14 | Ferdi.loop(getMessages); |
13 | }; | 15 | }; |