Let guests keep a published rule via Save & Exit and a post-finalize sign-in prompt.

Email is optional so they can continue without saving; skip from Save & Exit leaves the flow instead of returning to completed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-09-02 16:18:41 -06:00
co-authored by Cursor
parent 84ef943df4
commit db34a1f0df
17 changed files with 521 additions and 60 deletions
+22
View File
@@ -0,0 +1,22 @@
/**
* Guest finalize → `/create/completed` keep-this-rule login. Stored in
* sessionStorage so the prompt survives create-layout remounts and is not
* tied to the Finalize click (that click would otherwise dismiss the overlay).
*/
export const CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY =
"createFlow.pendingKeepRuleLogin";
export function writePendingKeepRuleLogin(): void {
if (typeof sessionStorage === "undefined") return;
sessionStorage.setItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY, "1");
}
export function hasPendingKeepRuleLogin(): boolean {
if (typeof sessionStorage === "undefined") return false;
return sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY) === "1";
}
export function clearPendingKeepRuleLogin(): void {
if (typeof sessionStorage === "undefined") return;
sessionStorage.removeItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY);
}