Emit task:stateChange event

pull/774/head
Zef Hemel 2024-02-28 10:55:08 +01:00
parent ff9b39cb5e
commit 59ab0cbaff
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import type { ClickEvent, IndexTreeEvent } from "$type/types.ts";
import { editor, markdown, space, sync } from "$sb/syscalls.ts";
import { editor, events, markdown, space, sync } from "$sb/syscalls.ts";
import {
addParentPointers,
@ -191,6 +191,13 @@ async function cycleTaskState(
await updateTaskState(ref, stateText, changeTo);
}
}
await events.dispatchEvent("task:stateChange", {
from: node.parent!.from,
to: node.parent!.to,
newState: changeTo,
text: renderToText(node.parent),
});
}
export async function updateTaskState(