Resume the draft from Create rule instead of deleting it.

This commit is contained in:
adilallo committed 2026-11-22 17:51:21 -07:00
1 parent d31045b0e5
commit a846169960
9 files changed
+119 -71

No files matched your search

@@ -15,7 +15,7 @@ import AvatarContainer from "../../asset/AvatarContainer";
import Avatar from "../../asset/Avatar";
import { getAssetPath, ASSETS } from "../../../../lib/assetUtils";
import { PRODUCTION_SITE_ORIGIN, websiteJsonLd } from "../../../../lib/siteMetadata";
import { prepareFreshCreateFlowEntrySync } from "../../../(app)/create/utils/prepareFreshCreateFlowEntry";
import { createRuleEntryPath } from "../../../(app)/create/utils/createRuleEntry";
import { TopView } from "./Top.view";
import type { TopProps } from "./Top.types";
@@ -59,16 +59,12 @@ const TopContainer = memo<TopProps>(
/**
* `Top` is hidden on `/create` routes by ConditionalNavigationClient, so
* this button is always clicked from outside the wizard. Clears anonymous
* `localStorage` synchronously and, when backend sync is on, fires the
* server `DELETE /api/drafts/me` in the background. `SignedInDraftHydration`
* reads the `create:fresh-entry-pending` sentinel and waits before fetching
* (see {@link prepareFreshCreateFlowEntrySync}).
* this button is always clicked from outside the wizard. Resume the draft
* in the browser instead of wiping it.
*/
const handleCreateRuleClick = useCallback(() => {
prepareFreshCreateFlowEntrySync({ signedIn: loggedIn });
router.push("/create/informational");
}, [loggedIn, router]);
router.push(createRuleEntryPath());
}, [router]);
const schemaData = websiteJsonLd(siteOrigin);