From d48cdcd25c54a424eaa3492426b2e339a730d3c2 Mon Sep 17 00:00:00 2001 From: YoniKiriaty Date: Wed, 18 Feb 2026 18:04:25 +0200 Subject: [PATCH 1/2] Yoni - saved scoutername --- apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx | 8 ++++++-- .../frontend/src/scouter/pages/tabs/PostMatchTab.tsx | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx b/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx index 29a2202..378e7db 100644 --- a/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx +++ b/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx @@ -170,8 +170,12 @@ const SideBar: FC = ({ setActiveTab, activeTabIndex }) => { ); }; -export const createNewScoutingForm = (): ScoutingForm => - JSON.parse(JSON.stringify(defaultScoutForm)); +export const createNewScoutingForm = ( + savedInfo?: Partial, +): ScoutingForm => ({ + ...JSON.parse(JSON.stringify(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={() => { From 5cd9021cbd1a949716964f53908177fb16a9f2fc Mon Sep 17 00:00:00 2001 From: YoniKiriaty Date: Wed, 18 Feb 2026 20:12:57 +0200 Subject: [PATCH 2/2] Yoni - switched to structured clone --- apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx b/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx index 378e7db..eaae4f7 100644 --- a/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx +++ b/apps/scouting/frontend/src/scouter/pages/ScoutMatch.tsx @@ -172,10 +172,7 @@ const SideBar: FC = ({ setActiveTab, activeTabIndex }) => { }; export const createNewScoutingForm = ( savedInfo?: Partial, -): ScoutingForm => ({ - ...JSON.parse(JSON.stringify(defaultScoutForm)), - ...savedInfo, -}); +): ScoutingForm => structuredClone({ ...defaultScoutForm, ...savedInfo }); export const ScoutMatch: FC = () => { const [scoutingForm, setScoutingForm] = useLocalStorage( "form",