Skip to content

Commit

Permalink
fix(bug): string hidden-property duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
YU000jp committed Oct 11, 2023
1 parent 3b34b51 commit 0ba65ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ const hiddenProperty = (inputDate: string, taskBlock: BlockEntity) => {
logseq.Editor.restoreEditingCursor();
setTimeout(async () => {
logseq.Editor.editBlock(taskBlock.uuid);
if (taskBlock.properties?.string) logseq.Editor.removeBlockProperty(taskBlock.uuid, "string"); //2重にならないように削除
setTimeout(() => logseq.Editor.insertAtEditingCursor(`\nstring:: ${format(hiddenProperty, 'yyyyMMdd')}`), 100);
}, 500);
}
Expand All @@ -443,7 +444,10 @@ function onBlockChanged() {
if (demoGraph === true) return;
if (logseq.settings!.removePropertyWithoutDONEtask === true) {
const CompletedOff = blocks.find(({ marker, properties }) => marker !== "DONE" && properties && properties[logseq.settings?.customPropertyName || "completed"]);
if (CompletedOff) logseq.Editor.removeBlockProperty(CompletedOff.uuid, logseq.settings?.customPropertyName || "completed");
if (CompletedOff) {
logseq.Editor.removeBlockProperty(CompletedOff.uuid, logseq.settings?.customPropertyName || "completed");
if (CompletedOff.properties?.string) logseq.Editor.removeBlockProperty(CompletedOff.uuid, "string"); //2重にならないように削除
}
}
const taskBlock = blocks.find(
({ marker, uuid }) => marker === "DONE" && blockSet !== uuid
Expand Down

0 comments on commit 0ba65ca

Please sign in to comment.