diff --git a/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx b/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx index 29a2202..eaae4f7 100644 --- a/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx +++ b/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx @@ -170,8 +170,9 @@ const SideBar: FC = ({ setActiveTab, activeTabIndex }) => { ); }; -export const createNewScoutingForm = (): ScoutingForm => - JSON.parse(JSON.stringify(defaultScoutForm)); +export const createNewScoutingForm = ( + savedInfo?: Partial, +): ScoutingForm => structuredClone({ ...defaultScoutForm, ...savedInfo }); export const ScoutMatch: FC = () => { const [scoutingForm, setScoutingForm] = useLocalStorage( "form", diff --git a/apps/scouting/frontend/src/scouter/pages/tabs/PostMatchTab.tsx b/apps/scouting/frontend/src/scouter/pages/tabs/PostMatchTab.tsx index 57349e4..5100d12 100644 --- a/apps/scouting/frontend/src/scouter/pages/tabs/PostMatchTab.tsx +++ b/apps/scouting/frontend/src/scouter/pages/tabs/PostMatchTab.tsx @@ -21,7 +21,7 @@ export const PostMatchTab: FC = ({ setForm, currentForm }) => { const navigate = useNavigate(); const handleSubmit = async () => { - setForm(createNewScoutingForm()); + setForm(createNewScoutingForm({ scouterName: currentForm.scouterName })); setScoutingForms((prev) => [...prev, currentForm]); await navigate("/"); }; @@ -91,7 +91,9 @@ export const PostMatchTab: FC = ({ setForm, currentForm }) => { {isPopUpVisible && ( { - setForm(createNewScoutingForm); + setForm( + createNewScoutingForm({ scouterName: currentForm.scouterName }), + ); void navigate("/"); }} close={() => {