Skip to content

Commit

Permalink
fix counters in todoist
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maxandersen committed Aug 30, 2023
1 parent 580a8ed commit a5b0807
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion recipes/todoist/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 6 additions & 2 deletions recipes/todoist/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a5b0807

Please sign in to comment.