Skip to content

Commit 9e15f32

Browse files
committed
feat: remove form when session is active
1 parent 4ad5f8d commit 9e15f32

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

apps/web/src/routes/_app/session/start-session.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,18 @@ const RouteComponent = () => {
4242
</Heading>
4343
</PageHeader>
4444
<div className="space-y-4">
45-
<StartSessionForm
46-
currentGroup={currentGroup}
47-
initialValues={initialValues}
48-
readOnly={currentSession !== null || createSessionMutation.isPending}
49-
username={currentUser?.username}
50-
onSubmit={async (formData) => {
51-
const session = await createSessionMutation.mutateAsync(formData);
52-
startSession({ ...session, type: formData.type });
53-
}}
54-
/>
45+
{currentSession == null && (
46+
<StartSessionForm
47+
currentGroup={currentGroup}
48+
initialValues={initialValues}
49+
readOnly={currentSession !== null || createSessionMutation.isPending}
50+
username={currentUser?.username}
51+
onSubmit={async (formData) => {
52+
const session = await createSessionMutation.mutateAsync(formData);
53+
startSession({ ...session, type: formData.type });
54+
}}
55+
/>
56+
)}
5557
{currentSession !== null && (
5658
<div className="mx-auto block max-h-fit max-w-3xl rounded-lg border border-gray-200 bg-white p-6 opacity-70 shadow-sm dark:border-gray-700 dark:bg-gray-800">
5759
<p className="max-w-4xl text-center text-yellow-600 dark:text-yellow-300">

0 commit comments

Comments
 (0)