Skip to content

Commit

Permalink
fix: fixed journals template properties missing, #63
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonn committed Feb 4, 2024
1 parent c7dc80e commit 450cdf9
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 450cdf9

Please sign in to comment.