Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/fix-project-creation-navigation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Ensure creating a project completes instead of returning to its creation form after a navigation error.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { getFormProps, getInputProps, useForm } from "@conform-to/react";
import { parseWithZod } from "@conform-to/zod";
import { CommandLineIcon, FolderIcon } from "@heroicons/react/20/solid";
import { json, type ActionFunction, type LoaderFunctionArgs } from "@remix-run/node";
import {
json,
redirectDocument,
type ActionFunction,
type LoaderFunctionArgs,
} from "@remix-run/node";
import { Form, useActionData, useNavigation } from "@remix-run/react";
import type { Prisma } from "@trigger.dev/database";
import React, { useEffect, useState } from "react";
Expand Down Expand Up @@ -285,14 +290,17 @@ export const action: ActionFunction = async ({ request, params }) => {
if (next) {
params.set("next", next);
}
return redirect(`/vercel/connect?${params.toString()}`);
return redirectDocument(`/vercel/connect?${params.toString()}`);
Comment thread
carderne marked this conversation as resolved.
}

return redirectWithSuccessMessage(
v3ProjectPath(project.organization, project),
const destination = v3ProjectPath(project.organization, project);
const response = await redirectWithSuccessMessage(
destination,
request,
`${submission.value.projectName} created`
);

return redirectDocument(destination, { headers: response.headers });
Comment thread
carderne marked this conversation as resolved.
} catch (error) {
if (error instanceof ExceededProjectLimitError) {
return redirectWithErrorMessage(
Expand Down
Loading