diff options
author | 2021-10-05 17:04:09 +0200 | |
---|---|---|
committer | 2021-10-05 17:04:09 +0200 | |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/canvas/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/canvas/webview.js')
-rw-r--r-- | recipes/canvas/webview.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/recipes/canvas/webview.js b/recipes/canvas/webview.js index a70f448..070a975 100644 --- a/recipes/canvas/webview.js +++ b/recipes/canvas/webview.js | |||
@@ -2,9 +2,11 @@ module.exports = Ferdi => { | |||
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let direct = 0; | 3 | let direct = 0; |
4 | 4 | ||
5 | const MessageElement = document.querySelector('[id=global_nav_conversations_link]'); | 5 | const MessageElement = document.querySelector( |
6 | '[id=global_nav_conversations_link]', | ||
7 | ); | ||
6 | if (MessageElement) { | 8 | if (MessageElement) { |
7 | direct += Ferdi.safeParseInt(MessageElement.innerHTML); | 9 | direct += Ferdi.safeParseInt(MessageElement.textContent); |
8 | } | 10 | } |
9 | 11 | ||
10 | Ferdi.setBadge(direct); | 12 | Ferdi.setBadge(direct); |