Open a template from its cards even when a saved draft exists.

This commit is contained in:
adilallo committed 2026-11-22 18:08:34 -07:00
1 parent 851133e56d
commit 55b071aa83
11 files changed
+326 -140

No files matched your search

+11 -1
View File
@@ -21,7 +21,11 @@ import {
isCreateFlowTemplatesPickerPath,
parseCreateFlowScreenFromPathname,
} from "./utils/flowSteps";
import { hasFreshEntryPending } from "./utils/prepareFreshCreateFlowEntry";
import {
hasFreshEntryPending,
hasTemplateApplyLatch,
clearTemplateApplyLatch,
} from "./utils/prepareFreshCreateFlowEntry";
import { isBackendSyncEnabled } from "../../../lib/create/backendSyncEnabled";
@@ -94,6 +98,12 @@ export function SignedInDraftHydration({
return;
}
if (hasTemplateApplyLatch()) {
finishedUserIdRef.current = userId;
clearTemplateApplyLatch();
return;
}
// Local draft wins over server: no fetch, no replaceState. The provider
// already hydrated from localStorage at mount, so the user sees their
// unsaved keystrokes immediately.