diff options
author | 2021-10-05 17:04:09 +0200 | |
---|---|---|
committer | 2021-10-05 17:04:09 +0200 | |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/notion/webview.js | |
parent | chore: repo maintenance (#732) (diff) | |
download | ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip |
chore: add eslint-plugin-unicorn (#733)
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 | }; |