Full cleanup pass

This commit is contained in:
adilallo
2026-05-21 23:25:56 -06:00
parent 28de8ef3bc
commit 99f535f821
149 changed files with 2623 additions and 1242 deletions
@@ -13,10 +13,11 @@ export const CREATE_FLOW_TRANSFER_PENDING_KEY =
"create-flow-transfer-pending" as const;
/**
* When signed-in + sync, {@link SignedInDraftHydration} resolves server vs this key via `window.confirm`
* if both are non-empty; see `messages/en/create/draftHydration.json`.
* When signed-in + sync, local draft wins if non-empty; server draft applies when local is empty.
* See `messages/en/create/draftHydration.json`.
*/
// TODO(legacy): Remove after production soak — one-time migration from pre-anonymous keys.
const LEGACY_LIVE_KEY = "create-flow-state";
const LEGACY_DRAFT_KEY = "create-flow-draft";
@@ -2,8 +2,7 @@ import { deleteServerDraft } from "../../../../lib/create/api";
import { clearAnonymousCreateFlowStorage } from "./anonymousDraftStorage";
import { clearCoreValueDetailsLocalStorage } from "./coreValueDetailsLocalStorage";
const SYNC_ENABLED =
process.env.NEXT_PUBLIC_ENABLE_BACKEND_SYNC === "true";
import { isBackendSyncEnabled } from "../../../../lib/create/backendSyncEnabled";
/**
* Call **before** navigating into `/create` from marketing or profile “new rule”
@@ -17,7 +16,7 @@ const SYNC_ENABLED =
export async function prepareFreshCreateFlowEntry(): Promise<void> {
clearAnonymousCreateFlowStorage();
clearCoreValueDetailsLocalStorage();
if (SYNC_ENABLED) {
if (isBackendSyncEnabled()) {
await deleteServerDraft();
}
}