23 lines
882 B
TypeScript
23 lines
882 B
TypeScript
/**
|
|
* Guest publish → `/create/completed` keep-this-rule login. Stored in
|
|
* sessionStorage so the prompt survives create-layout remounts and is not
|
|
* tied to the Publish 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);
|
|
}
|