Skip to content

Commit e762338

Browse files
committed
fixes
1 parent f52277e commit e762338

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

  • apps/webapp/app/routes
    • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts.new
    • _app.orgs.$organizationSlug.settings.private-connections.new

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts.new/route.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Form, useActionData, useNavigate, useNavigation } from "@remix-run/reac
55
import { type LoaderFunctionArgs } from "@remix-run/router";
66
import { type ActionFunctionArgs, json } from "@remix-run/server-runtime";
77
import { SlackIcon } from "@trigger.dev/companyicons";
8-
import { useEffect, useState } from "react";
8+
import { useEffect, useRef, useState } from "react";
99
import { typedjson, useTypedLoaderData } from "remix-typedjson";
1010
import { z } from "zod";
1111
import { InlineCode } from "~/components/code/InlineCode";
@@ -217,6 +217,7 @@ export default function Page() {
217217
const project = useProject();
218218
const environment = useEnvironment();
219219
const [currentAlertChannel, setCurrentAlertChannel] = useState<string | null>(option ?? "EMAIL");
220+
const formRef = useRef<HTMLFormElement>(null);
220221

221222
const [selectedSlackChannelValue, setSelectedSlackChannelValue] = useState<string | undefined>();
222223

@@ -247,7 +248,7 @@ export default function Page() {
247248
if (navigation.state !== "idle") return;
248249
if (lastSubmission !== undefined) return;
249250

250-
form.reset();
251+
formRef.current?.reset();
251252
}, [navigation.state, lastSubmission]);
252253

253254
return (
@@ -261,7 +262,7 @@ export default function Page() {
261262
>
262263
<DialogContent>
263264
<DialogHeader>New alert</DialogHeader>
264-
<Form method="post" {...getFormProps(form)}>
265+
<Form ref={formRef} method="post" {...getFormProps(form)}>
265266
<Fieldset className="mt-2">
266267
<InputGroup fullWidth>
267268
<SegmentedControl

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.private-connections.new/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getFormProps, getInputProps, useForm } from "@conform-to/react";
1+
import { getFormProps, getInputProps, getSelectProps, useForm } from "@conform-to/react";
22
import { parseWithZod } from "@conform-to/zod";
33
import { Form, useActionData, useParams, type MetaFunction } from "@remix-run/react";
44
import { json, type ActionFunction, type LoaderFunctionArgs } from "@remix-run/server-runtime";
@@ -755,7 +755,7 @@ export default function Page() {
755755
Target region
756756
</Label>
757757
<select
758-
{...getInputProps(targetRegion, { type: "text" })}
758+
{...getSelectProps(targetRegion)}
759759
defaultValue={defaultRegion}
760760
className="w-full rounded-md border border-charcoal-700 bg-charcoal-800 px-3 py-2 text-sm text-text-bright"
761761
>

0 commit comments

Comments
 (0)