Resume the draft from Create rule instead of deleting it.

This commit is contained in:
adilallo committed 2026-11-22 17:51:21 -07:00
1 parent d31045b0e5
commit a846169960
9 files changed
+119 -71

No files matched your search

@@ -4,38 +4,21 @@
* Figma: "Section / Your Turn" (24239:1397)
*/
import { memo, useCallback, useEffect, useState } from "react";
import { memo, useCallback, useState } from "react";
import { useRouter } from "next/navigation";
import { useMessages } from "../../../contexts/MessagesContext";
import { fetchAuthSession } from "../../../../lib/create/api";
import { prepareFreshCreateFlowEntrySync } from "../../../(app)/create/utils/prepareFreshCreateFlowEntry";
import { createRuleEntryPath } from "../../../(app)/create/utils/createRuleEntry";
import AskOrganizerInquiryModal from "../../modals/AskOrganizerInquiry";
import YourTurnView from "./YourTurn.view";
const YourTurnContainer = memo(() => {
const router = useRouter();
const copy = useMessages().pages.about.yourTurn;
const [signedIn, setSignedIn] = useState(false);
const [inquiryOpen, setInquiryOpen] = useState(false);
useEffect(() => {
let cancelled = false;
void fetchAuthSession()
.then(({ user }) => {
if (!cancelled) setSignedIn(Boolean(user));
})
.catch(() => {
/* guest fallback */
});
return () => {
cancelled = true;
};
}, []);
const onCreateRule = useCallback(() => {
prepareFreshCreateFlowEntrySync({ signedIn });
router.push("/create/informational");
}, [router, signedIn]);
router.push(createRuleEntryPath());
}, [router]);
return (
<>