diff options
Diffstat (limited to 'recipes/feedly')
-rw-r--r-- | recipes/feedly/package.json | 2 | ||||
-rw-r--r-- | recipes/feedly/webview.js | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/recipes/feedly/package.json b/recipes/feedly/package.json index 70442bc..c1fa2ed 100644 --- a/recipes/feedly/package.json +++ b/recipes/feedly/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "feedly", | 2 | "id": "feedly", |
3 | "name": "Feedly", | 3 | "name": "Feedly", |
4 | "version": "1.1.2", | 4 | "version": "1.1.3", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://feedly.com" | 7 | "serviceURL": "https://feedly.com" |
diff --git a/recipes/feedly/webview.js b/recipes/feedly/webview.js index 3e15fd5..c1108ff 100644 --- a/recipes/feedly/webview.js +++ b/recipes/feedly/webview.js | |||
@@ -2,11 +2,14 @@ module.exports = Ferdi => { | |||
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | const newsDOM = document.querySelectorAll( | 3 | const newsDOM = document.querySelectorAll( |
4 | "div[title='All'] > .LeftnavListRow__count", | 4 | "div[title='All'] > .LeftnavListRow__count", |
5 | )[0].textContent; | 5 | ); |
6 | let counter = Ferdi.safeParseInt(newsDOM); | ||
7 | 6 | ||
8 | if (newsDOM && (newsDOM.includes('K') || newsDOM.includes('+'))) { | 7 | let counter = 0; |
9 | counter = `${newsDOM.slice(0, Math.max(0, newsDOM.indexOf('K')))}000`; | 8 | |
9 | if (newsDOM && newsDOM.length > 0) { | ||
10 | const textContent = newsDOM[0].textContent; | ||
11 | |||
12 | counter = textContent.includes('K') || textContent.includes('+') ? `${textContent.slice(0, Math.max(0, textContent.indexOf('K')))}000` : Ferdi.safeParseInt(textContent); | ||
10 | } | 13 | } |
11 | 14 | ||
12 | Ferdi.setBadge(counter); | 15 | Ferdi.setBadge(counter); |