From cea725398da94e59a95fc409cfec6e2529d88dd8 Mon Sep 17 00:00:00 2001 From: Kevin Zheng Date: Tue, 25 Apr 2023 02:01:10 +1000 Subject: [PATCH] Reset parameters when map changes --- client/src/components/app-bar/Input.tsx | 6 +++++- client/src/services/SpecimenService.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/app-bar/Input.tsx b/client/src/components/app-bar/Input.tsx index 810383be..356e901b 100644 --- a/client/src/components/app-bar/Input.tsx +++ b/client/src/components/app-bar/Input.tsx @@ -74,7 +74,11 @@ export function Input() { } break; default: - setUIState({ ...mapDefaults, map: find(maps, { id: v }) }); + setUIState({ + ...mapDefaults, + map: find(maps, { id: v }), + parameters: {}, + }); notify("Solution was cleared because the map changed."); break; } diff --git a/client/src/services/SpecimenService.tsx b/client/src/services/SpecimenService.tsx index 46c4369f..1ddcc5c1 100644 --- a/client/src/services/SpecimenService.tsx +++ b/client/src/services/SpecimenService.tsx @@ -45,7 +45,7 @@ async function solve( export function SpecimenService() { const usingLoadingState = useLoadingState("specimen"); const notify = useSnackbar(); - const [{ formats, algorithms }] = useFeatures(); + const [{ formats }] = useFeatures(); const [{ algorithm, start, end, parameters }, setUIState] = useUIState(); const resolve = useConnectionResolver(); const [connections] = useConnections();