aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/reddit
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
commitdfae2d231e39c81827d08fd8834d736c5b3005b1 (patch)
tree5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/reddit
parentNew recipe: odoo (diff)
downloadferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.gz
ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.zst
ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.zip
refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes.
Diffstat (limited to 'recipes/reddit')
-rw-r--r--recipes/reddit/package.json2
-rw-r--r--recipes/reddit/webview.js3
2 files changed, 2 insertions, 3 deletions
diff --git a/recipes/reddit/package.json b/recipes/reddit/package.json
index 7dd62e2..b1e9399 100644
--- a/recipes/reddit/package.json
+++ b/recipes/reddit/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "reddit", 2 "id": "reddit",
3 "name": "Reddit", 3 "name": "Reddit",
4 "version": "1.1.0", 4 "version": "1.1.1",
5 "license": "MIT", 5 "license": "MIT",
6 "repository": "https://github.com/getferdi/recipes", 6 "repository": "https://github.com/getferdi/recipes",
7 "config": { 7 "config": {
diff --git a/recipes/reddit/webview.js b/recipes/reddit/webview.js
index dc83d3d..ad2c83e 100644
--- a/recipes/reddit/webview.js
+++ b/recipes/reddit/webview.js
@@ -8,10 +8,9 @@ module.exports = (Ferdi) => {
8 let count = 0; 8 let count = 0;
9 9
10 if (elements[0]) { 10 if (elements[0]) {
11 count = parseInt(elements[0].innerHTML, 10); 11 count = Ferdi.safeParseInt(elements[0].innerHTML);
12 } 12 }
13 13
14 console.log(count);
15 Ferdi.setBadge(count); 14 Ferdi.setBadge(count);
16 }; 15 };
17 16