Turn a saved draft into the finished Rule, and greet with congratulations.

This commit is contained in:
adilallo committed 2026-11-22 18:01:56 -07:00
1 parent a2815ae05f
commit 851133e56d
11 files changed
+150 -23

No files matched your search

+9
View File
@@ -247,6 +247,15 @@ export function isValidStep(
);
}
/** Resume a saved draft on the screen it was left on. */
export function resumeCreateFlowStep(
state: { currentStep?: CreateFlowStep } | null | undefined,
): CreateFlowStep {
const step = state?.currentStep;
if (step && isValidStep(step)) return step;
return FIRST_STEP;
}
/**
* Parses `/create/{screenId}` (and optional trailing segments) from pathname.
* Returns null for non-wizard paths (e.g. `/create/review-template/...`).