Skip to content

Commit

Permalink
Merge pull request #70 from ahonn/fix/fix-logseq-journals-template-pr…
Browse files Browse the repository at this point in the history
…operties-missing

fix: fixed journals template properties missing, #63
  • Loading branch information
ahonn authored Feb 4, 2024
2 parents ece3b5d + 450cdf9 commit 9dc68f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/state/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ async function getTaskEntitiesByQuery(query: string) {
const page = await window.logseq.Editor.getPage(
(block?.page as PageEntity).name,
);
if (page === undefined) {
return null;
}

if (page?.journalDay) {
const blocksTree = await window.logseq.Editor.getPageBlocksTree(page!.uuid);
page.properties = Object.assign(page.properties ?? {}, blocksTree[0].properties)
}

const taskEntity = new TaskEntity(block!, page!);
if (
taskEntity.content.startsWith('((') &&
Expand All @@ -39,7 +48,6 @@ async function getTaskEntitiesByQuery(query: string) {
}
}
}
console.log(taskEntity.toObject());
return taskEntity;
}),
);
Expand Down

0 comments on commit 9dc68f6

Please sign in to comment.