Skip to content

Commit

Permalink
Add scheduled function
Browse files Browse the repository at this point in the history
  • Loading branch information
benjypng committed Dec 14, 2021
1 parent 94955ac commit d6195d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "logseq-todoist-plugin",
"version": "2.4",
"version": "2.5",
"author": "hkgnp",
"description": "Simple Todoist plugin to pull only active tasks from specified project, i.e. Inbox",
"logseq": {
Expand Down
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class App extends React.Component {
logseq.updateSettings({
clearTasks: true,
});
console.log(this.state.clearTasks);
};

handleInput = (e: any) => {
Expand Down
8 changes: 6 additions & 2 deletions src/handle-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ type Task = {
id: number;
content: string;
description: string;
due: {
date: string;
};
};

type Id = {
Expand Down Expand Up @@ -51,7 +54,8 @@ const handleTasksWithoutPrefix = async () => {
.map((t: Task) => ({
todoist_id: t.id,
content: `TODO ${t.content}
${t.description ? 'description:: ' + t.description : ''}`,
${t.due.date && `SCHEDULED: <${t.due.date} a>`}
${t.description && `description:: ${t.description}`}`,
children: [],
}));

Expand Down Expand Up @@ -135,7 +139,7 @@ const handleTasksWithPrefix = async () => {
.map((t: Task) => ({
todoist_id: t.id,
content: `${t.content}
${t.description ? 'description:: ' + t.description : ''}`,
${t.description && 'description:: ' + t.description}`,
children: [],
}));

Expand Down

0 comments on commit d6195d9

Please sign in to comment.