refactor: fix exit-1 comment, remove JSON round-trip, use OfficeMeta cast

This commit is contained in:
jiayiyan
2026-05-18 16:41:37 +08:00
parent 6d069c955f
commit ed728b2ad9
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { END, type ModeratorCondition, type ModeratorTable, START } from "@uncaged/workflow-runtime";
import type { DocumentEditorMeta } from "./roles.js";
import type { DocumentEditorMeta, OfficeMeta } from "./roles.js";
const officeIsEdit: ModeratorCondition<DocumentEditorMeta> = {
name: "officeIsEdit",
@@ -7,7 +7,7 @@ const officeIsEdit: ModeratorCondition<DocumentEditorMeta> = {
check: (ctx) => {
const officeStep = ctx.steps.find((s) => s.role === "office");
if (officeStep === undefined) return false;
return (officeStep.meta as { mode: string }).mode === "edit";
return (officeStep.meta as OfficeMeta).mode === "edit";
},
};