Open a finished Rule from its Profile card, and drop it from the browser on Log out.
This commit is contained in:
1 parent
db1599123b
commit
942c7cc9de
17 files changed
+280
-14
No files matched your search
@@ -2,8 +2,8 @@ import type { CopiedNameHit } from "./copiedRuleDocument";
|
||||
|
||||
/**
|
||||
* Bridges final-review → completed without query strings, and re-opens a rule
|
||||
* from profile (`/create/completed?ruleId=…`) after GET /api/rules/[id]. Profile
|
||||
* "Manage" links here; stakeholder "View" uses `/invite/[id]`.
|
||||
* from profile (`/create/completed?ruleId=…`) after GET /api/rules/[id].
|
||||
* Stakeholder cards on Profile open the reader page at `/rules/[id]`.
|
||||
*/
|
||||
export const CREATE_FLOW_LAST_PUBLISHED_KEY = "createFlow.lastPublished";
|
||||
|
||||
@@ -35,6 +35,11 @@ export function writeLastPublishedRule(data: StoredLastPublishedRule): void {
|
||||
sessionStorage.setItem(CREATE_FLOW_LAST_PUBLISHED_KEY, JSON.stringify(data));
|
||||
}
|
||||
|
||||
export function clearLastPublishedRule(): void {
|
||||
if (typeof sessionStorage === "undefined") return;
|
||||
sessionStorage.removeItem(CREATE_FLOW_LAST_PUBLISHED_KEY);
|
||||
}
|
||||
|
||||
export function readLastPublishedRule(): StoredLastPublishedRule | null {
|
||||
if (typeof sessionStorage === "undefined") return null;
|
||||
const raw = sessionStorage.getItem(CREATE_FLOW_LAST_PUBLISHED_KEY);
|
||||
|
||||
@@ -61,7 +61,7 @@ export async function issueGuestRuleClaimCookie(token: string): Promise<void> {
|
||||
);
|
||||
}
|
||||
|
||||
async function clearGuestRuleClaimCookie(): Promise<void> {
|
||||
export async function clearGuestRuleClaimCookie(): Promise<void> {
|
||||
const store = await cookies();
|
||||
store.set(GUEST_RULE_CLAIM_COOKIE_NAME, "", {
|
||||
...cookieOptions(),
|
||||
|
||||
Reference in new issue
Block a user