Keep a continued draft on screen, ask before Edit drops rewritten copy, and retry clearing the draft after publish.

This commit is contained in:
adilallo committed 2026-11-22 18:31:07 -07:00
1 parent 54a4871ad1
commit 7c08766092
11 files changed
+361 -41

No files matched your search

@@ -0,0 +1,21 @@
import type { CreateFlowState } from "../types";
import { forgetFlushedCommunityAvatarUrl } from "../../../../lib/create/flushPendingCommunityAvatar";
import { clearPendingCommunityAvatarFile } from "../../../../lib/create/pendingCommunityAvatarUpload";
import {
clearTransferPendingFlag,
writeAnonymousCreateFlowState,
} from "./anonymousDraftStorage";
import { writeCoreValueDetailsToLocalStorage } from "./coreValueDetailsLocalStorage";
/**
* Profile already has the server draft. Write that snapshot into the browser
* before opening the wizard so the create flow can mount it immediately,
* including when backend sync is off and hydration will not refetch.
*/
export function seedContinuedDraftLocalStorage(state: CreateFlowState): void {
writeAnonymousCreateFlowState(state);
writeCoreValueDetailsToLocalStorage(state.coreValueDetailsByChipId);
clearTransferPendingFlag();
forgetFlushedCommunityAvatarUrl();
void clearPendingCommunityAvatarFile();
}