aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/notion
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/notion')
-rw-r--r--recipes/notion/package.json2
-rw-r--r--recipes/notion/webview.js5
2 files changed, 3 insertions, 4 deletions
diff --git a/recipes/notion/package.json b/recipes/notion/package.json
index d5d504c..1cefed4 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.1.0", 4 "version": "1.1.1",
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 8ef9ff2..aa8eaec 100644
--- a/recipes/notion/webview.js
+++ b/recipes/notion/webview.js
@@ -1,13 +1,12 @@
1module.exports = (Ferdi) => { 1module.exports = (Ferdi) => {
2 function getMessages() { 2 function getMessages() {
3 let direct = 0; 3 let direct = 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'); 4 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) { 5 if (badgeDiv) {
7 direct = parseInt(badgeDiv.innerText); 6 direct = Ferdi.safeParseInt(badgeDiv.innerText);
8 } 7 }
9 8
10 Ferdi.setBadge(direct, indirect); 9 Ferdi.setBadge(direct);
11 } 10 }
12 11
13 Ferdi.loop(getMessages); 12 Ferdi.loop(getMessages);