diff --git a/packages/frontend/src/components/issue-form.tsx b/packages/frontend/src/components/issue-form.tsx index d325ec7..f438892 100644 --- a/packages/frontend/src/components/issue-form.tsx +++ b/packages/frontend/src/components/issue-form.tsx @@ -1,6 +1,6 @@ import { ISSUE_DESCRIPTION_MAX_LENGTH, ISSUE_TITLE_MAX_LENGTH } from "@sprint/shared"; -import { type FormEvent, useMemo, useState } from "react"; +import { type FormEvent, useEffect, useMemo, useState } from "react"; import { toast } from "sonner"; import { MultiAssigneeSelect } from "@/components/multi-assignee-select"; import { useAuthenticatedSession } from "@/components/session-provider"; @@ -57,6 +57,10 @@ export function IssueForm({ trigger }: { trigger?: React.ReactNode }) { const [assigneeIds, setAssigneeIds] = useState(["unassigned"]); const [status, setStatus] = useState(defaultStatus); const [type, setType] = useState(defaultType); + useEffect(() => { + if (!status && defaultStatus) setStatus(defaultStatus); + if (!type && defaultType) setType(defaultType); + }, [defaultStatus, defaultType, status, type]); const [submitAttempted, setSubmitAttempted] = useState(false); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(null); diff --git a/todo.md b/todo.md index d1dfaee..4b511e9 100644 --- a/todo.md +++ b/todo.md @@ -1,7 +1,6 @@ # HIGH PRIORITY - BUGS: -- on the first attempt since page load, pressing the create issue button the default type and status are not loaded - FEATURES: - make login/register into a modal that appears atop the landing page - user preferences