diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-17 10:47:32 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-17 10:47:32 +0530 |
commit | 212d5846427ceeacfadf5aac3f381b532f4664a1 (patch) | |
tree | 7badcbb01930e77a2b2745e189e89323111ef470 /recipes/notion | |
parent | Moved all npm packages to the 'devDependencies' since there is no node-runtim... (diff) | |
download | ferdium-recipes-212d5846427ceeacfadf5aac3f381b532f4664a1.tar.gz ferdium-recipes-212d5846427ceeacfadf5aac3f381b532f4664a1.tar.zst ferdium-recipes-212d5846427ceeacfadf5aac3f381b532f4664a1.zip |
Cleanup of recipes to remove 'NaN' of badge variables since this is handled in the main program.
Diffstat (limited to 'recipes/notion')
-rw-r--r-- | recipes/notion/package.json | 2 | ||||
-rw-r--r-- | recipes/notion/webview.js | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/recipes/notion/package.json b/recipes/notion/package.json index 13e37ee..974142c 100644 --- a/recipes/notion/package.json +++ b/recipes/notion/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "notion", | 2 | "id": "notion", |
3 | "name": "Notion", | 3 | "name": "Notion", |
4 | "version": "1.0.3", | 4 | "version": "1.0.4", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/TanZng/ferdi-notion", | 6 | "repository": "https://github.com/TanZng/ferdi-notion", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/notion/webview.js b/recipes/notion/webview.js index d01434e..f87907e 100644 --- a/recipes/notion/webview.js +++ b/recipes/notion/webview.js | |||
@@ -4,8 +4,7 @@ module.exports = (Franz) => { | |||
4 | const indirect = 0; | 4 | const indirect = 0; |
5 | const badgeDiv = document.querySelector('.notion-sidebar-container > div > div > div > :nth-child(4) > :nth-child(2) > div > :nth-child(3) > div > div'); | 5 | const badgeDiv = document.querySelector('.notion-sidebar-container > div > div > div > :nth-child(4) > :nth-child(2) > div > :nth-child(3) > div > div'); |
6 | if (badgeDiv) { | 6 | if (badgeDiv) { |
7 | const count = parseInt(badgeDiv.innerText); | 7 | direct = parseInt(badgeDiv.innerText); |
8 | direct = isNaN(count) ? 0 : count; | ||
9 | } | 8 | } |
10 | 9 | ||
11 | Franz.setBadge(direct, indirect); | 10 | Franz.setBadge(direct, indirect); |