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/feedly/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/feedly/webview.js')
-rw-r--r-- | recipes/feedly/webview.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/recipes/feedly/webview.js b/recipes/feedly/webview.js index 1c313e7..3e15fd5 100644 --- a/recipes/feedly/webview.js +++ b/recipes/feedly/webview.js | |||
@@ -1,10 +1,12 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | const newsDOM = document.querySelectorAll("div[title='All'] > .LeftnavListRow__count")[0].innerHTML; | 3 | const newsDOM = document.querySelectorAll( |
4 | "div[title='All'] > .LeftnavListRow__count", | ||
5 | )[0].textContent; | ||
4 | let counter = Ferdi.safeParseInt(newsDOM); | 6 | let counter = Ferdi.safeParseInt(newsDOM); |
5 | 7 | ||
6 | if (newsDOM.indexOf('K') !== -1 || newsDOM.indexOf('+') !== -1) { | 8 | if (newsDOM && (newsDOM.includes('K') || newsDOM.includes('+'))) { |
7 | counter = `${newsDOM.substring(0, newsDOM.indexOf('K'))}000`; | 9 | counter = `${newsDOM.slice(0, Math.max(0, newsDOM.indexOf('K')))}000`; |
8 | } | 10 | } |
9 | 11 | ||
10 | Ferdi.setBadge(counter); | 12 | Ferdi.setBadge(counter); |