Keep a reopened template draft off the setup questions.
This commit is contained in:
1 parent
6498d52541
commit
c7f88e5515
3 files changed
+55
-3
No files matched your search
@@ -25,6 +25,7 @@ import {
|
||||
CREATE_FLOW_REVIEW_RETURN_QUERY_KEY,
|
||||
getNextStep,
|
||||
parseReviewReturnSearchParam,
|
||||
templatePathSkippedCommunityRedirect,
|
||||
shouldOfferCreateFlowSaveAndExit,
|
||||
isDirectTemplateReviewEntry,
|
||||
createFlowStepUsesSelectSplitScroll,
|
||||
@@ -101,6 +102,7 @@ import {
|
||||
EMPTY_SETUP_TRAITS,
|
||||
hasTickedSetupTrait,
|
||||
} from "../../../lib/create/setupTraits";
|
||||
import { templatePathFromState } from "../../../lib/create/templatePath";
|
||||
import { useAuthModal } from "../../contexts/AuthModalContext";
|
||||
import { useMessages, useTranslation } from "../../contexts/MessagesContext";
|
||||
import { PostLoginDraftTransfer } from "./PostLoginDraftTransfer";
|
||||
@@ -424,7 +426,18 @@ function CreateFlowLayoutContent({
|
||||
await runAuthenticatedExit(opts);
|
||||
};
|
||||
|
||||
const templatePathRedirect = templatePathSkippedCommunityRedirect(
|
||||
currentStep,
|
||||
templatePathFromState(state)?.mode,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!templatePathRedirect) return;
|
||||
router.replace(createFlowStepPath(templatePathRedirect));
|
||||
}, [router, templatePathRedirect]);
|
||||
|
||||
useEffect(() => {
|
||||
if (templatePathRedirect) return;
|
||||
if (
|
||||
sessionResolved &&
|
||||
sessionUser &&
|
||||
@@ -432,7 +445,7 @@ function CreateFlowLayoutContent({
|
||||
) {
|
||||
router.replace(CREATE_ROUTES.review);
|
||||
}
|
||||
}, [sessionResolved, sessionUser, currentStep, router]);
|
||||
}, [sessionResolved, sessionUser, currentStep, router, templatePathRedirect]);
|
||||
|
||||
useEffect(() => {
|
||||
clearAttempted();
|
||||
@@ -967,9 +980,9 @@ function CreateFlowLayoutContent({
|
||||
<main
|
||||
className={`flex min-h-0 min-w-0 flex-1 w-full max-w-full overflow-x-hidden ${CREATE_FLOW_SCROLL_REGION_CLASS} ${mainContentClass} ${mainResponsiveLayout}`}
|
||||
>
|
||||
{children}
|
||||
{templatePathRedirect ? null : children}
|
||||
</main>
|
||||
{!isCompletedStep && (
|
||||
{!isCompletedStep && !templatePathRedirect && (
|
||||
<CreateFlowFooter
|
||||
className="shrink-0"
|
||||
contentMaxClass={getCreateFlowContentMaxClass({
|
||||
|
||||
Reference in new issue
Block a user