diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-05 17:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 17:04:09 +0200 |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/twitter/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/twitter/webview.js')
-rw-r--r-- | recipes/twitter/webview.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/recipes/twitter/webview.js b/recipes/twitter/webview.js index dfd06d1..d88e3e4 100644 --- a/recipes/twitter/webview.js +++ b/recipes/twitter/webview.js | |||
@@ -4,13 +4,17 @@ module.exports = Ferdi => { | |||
4 | 4 | ||
5 | // "Notifications" and "Messages" - aria-label ending in | 5 | // "Notifications" and "Messages" - aria-label ending in |
6 | // "unread items". Sum the values for direct badge. | 6 | // "unread items". Sum the values for direct badge. |
7 | const notificationsElement = document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div'); | 7 | const notificationsElement = document.querySelector( |
8 | '[data-testid=AppTabBar_Notifications_Link] div div div', | ||
9 | ); | ||
8 | if (notificationsElement) { | 10 | if (notificationsElement) { |
9 | direct += Ferdi.safeParseInt(notificationsElement.innerHTML); | 11 | direct += Ferdi.safeParseInt(notificationsElement.textContent); |
10 | } | 12 | } |
11 | const DMElement = document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div'); | 13 | const DMElement = document.querySelector( |
14 | '[data-testid=AppTabBar_DirectMessage_Link] div div div', | ||
15 | ); | ||
12 | if (DMElement) { | 16 | if (DMElement) { |
13 | direct += Ferdi.safeParseInt(DMElement.innerHTML); | 17 | direct += Ferdi.safeParseInt(DMElement.textContent); |
14 | } | 18 | } |
15 | 19 | ||
16 | Ferdi.setBadge(direct); | 20 | Ferdi.setBadge(direct); |