Skip to content

Commit fc76814

Browse files
committed
feat(ui): persist guest migration metadata
1 parent 947fd9d commit fc76814

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/components/builder/guest-builder-client.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
import { useEffect, useRef } from "react";
44
import { useResumeStore } from "@/store/resume-store";
5-
import { EMPTY_RESUME_DATA, GUEST_STORAGE_KEY } from "@/lib/constants";
5+
import {
6+
EMPTY_RESUME_DATA,
7+
GUEST_MIGRATION_META_KEY,
8+
GUEST_STORAGE_KEY,
9+
} from "@/lib/constants";
610
import { BuilderForm } from "./builder-form";
711
import { BuilderPreview } from "./builder-preview";
812
import { BuilderHeader } from "./builder-header";
@@ -39,10 +43,19 @@ export function GuestBuilderClient() {
3943
useEffect(() => {
4044
if (!isStoreReadyRef.current) return;
4145
if (!isDirty) return;
46+
47+
const now = new Date().toISOString();
4248
localStorage.setItem(
4349
GUEST_STORAGE_KEY,
4450
JSON.stringify({ title, templateId, fontFamily, data })
4551
);
52+
localStorage.setItem(
53+
GUEST_MIGRATION_META_KEY,
54+
JSON.stringify({
55+
source: "try",
56+
lastDraftAt: now,
57+
})
58+
);
4659
}, [isDirty, title, templateId, fontFamily, data]);
4760

4861
return (

0 commit comments

Comments
 (0)