From a5b0807774e21573e1e0a97c87c69a2f5e0ab05a Mon Sep 17 00:00:00 2001 From: Max Rydahl Andersen Date: Wed, 30 Aug 2023 14:20:38 +0200 Subject: [PATCH] fix counters in todoist Why: * no counters shown for todoist integration; caused by todoist moving to use generated class names. This change addreses the need by: * use absolute element selectors instead of class names not as nice, but works as of now. --- recipes/todoist/package.json | 2 +- recipes/todoist/webview.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes/todoist/package.json b/recipes/todoist/package.json index 1a0622339..7272b6f1b 100644 --- a/recipes/todoist/package.json +++ b/recipes/todoist/package.json @@ -1,7 +1,7 @@ { "id": "todoist", "name": "Todoist", - "version": "1.5.0", + "version": "1.5.1", "license": "MIT", "repository": "https://github.com/meetfranz/recipe-todoist", "config": { diff --git a/recipes/todoist/webview.js b/recipes/todoist/webview.js index 32dc1f2ea..0dc53a994 100644 --- a/recipes/todoist/webview.js +++ b/recipes/todoist/webview.js @@ -8,8 +8,12 @@ module.exports = Ferdium => { function getTasks() { let todayCount = 0; let inboxCount = 0; - const todayElement = document.querySelector('#filter_today .item_counter'); - const inboxElement = document.querySelector('#filter_inbox .item_counter'); + const todayElement = document.querySelector( + '#filter_today div div a + span div span', + ); + const inboxElement = document.querySelector( + '#filter_inbox div div a + span div span', + ); if (todayElement) { todayCount = Ferdium.safeParseInt(todayElement.textContent);