Skip to content

Commit

Permalink
Reset parameters when map changes
Browse files Browse the repository at this point in the history
  • Loading branch information
spaaaacccee committed Apr 24, 2023
1 parent c67aa67 commit cea7253
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion client/src/components/app-bar/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/services/SpecimenService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cea7253

Please sign in to comment.