Keep a draft when opening a template from the catalog, instead of deleting it on click.
This commit is contained in:
1 parent
55b071aa83
commit
f634a91bb2
3 files changed
+7
-21
No files matched your search
@@ -5,7 +5,6 @@ import { useSearchParams } from "next/navigation";
|
||||
import HeaderLockup from "../../components/type/HeaderLockup";
|
||||
import { GovernanceTemplateGrid } from "../../components/sections/GovernanceTemplateGrid";
|
||||
import type { TemplateGridCardEntry } from "../../../lib/templates/templateGridPresentation";
|
||||
import { prepareFreshCreateFlowEntrySync } from "../../(app)/create/utils/prepareFreshCreateFlowEntry";
|
||||
import { buildTemplateReviewHref } from "../../(app)/create/utils/flowSteps";
|
||||
import { useTranslation } from "../../contexts/MessagesContext";
|
||||
|
||||
@@ -62,8 +61,7 @@ export default function TemplatesPageClient({
|
||||
}
|
||||
|
||||
/**
|
||||
* - `fromFlow=1` — skip `prepareFreshCreateFlowEntry` on template click
|
||||
* (draft preserved). Used by profile “Create from template”.
|
||||
* - `fromFlow=1` — in-wizard catalog; community answers stay until apply.
|
||||
* Templates carry no recommendation; the grid stays in curated order.
|
||||
*/
|
||||
function TemplatesGridWithSearchParams({
|
||||
@@ -91,13 +89,6 @@ function TemplatesGrid({
|
||||
hrefForTemplate={(slug) =>
|
||||
buildTemplateReviewHref(slug, { fromCreateWizard: fromFlow })
|
||||
}
|
||||
onTemplateClick={() => {
|
||||
if (!fromFlow) {
|
||||
// Marketing /templates has no session in hand; DELETE is
|
||||
// best-effort and the sentinel blocks stale-draft hydration.
|
||||
prepareFreshCreateFlowEntrySync({ signedIn: true });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user