Turn a saved draft into the finished Rule, and greet with congratulations.
This commit is contained in:
1 parent
a2815ae05f
commit
851133e56d
11 files changed
+150
-23
No files matched your search
@@ -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/...`).
|
||||
|
||||
Reference in new issue
Block a user