From 710bc8af727d95e268d7b23e012a8fe7ed9d48d9 Mon Sep 17 00:00:00 2001 From: HunterBarclay Date: Fri, 11 Oct 2024 17:01:11 -0600 Subject: [PATCH] fix: Delete and confirm work as expected. --- .../synthesis_brain/SynthesisBrain.ts | 8 +------ .../initial-config/InitialConfigPanel.tsx | 24 ++----------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts b/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts index 4fc9511f5..c98225cf5 100644 --- a/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts +++ b/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts @@ -18,7 +18,6 @@ import PreferencesSystem from "@/systems/preferences/PreferencesSystem" import { DefaultSequentialConfig } from "@/systems/preferences/PreferenceTypes" import InputSystem from "@/systems/input/InputSystem" import MirabufSceneObject from "@/mirabuf/MirabufSceneObject" -import { Global_AddToast } from "@/ui/components/GlobalUIControls" class SynthesisBrain extends Brain { public static brainIndexMap = new Map() @@ -95,12 +94,7 @@ class SynthesisBrain extends Brain { } public clearControls(): void { - if (InputSystem.brainIndexSchemeMap.delete(this._brainIndex)) { - Global_AddToast?.("info", "Controls", "Successfully cleared controls.") - } else { - Global_AddToast?.("warning", "Controls", "Failed to cleared controls.") - } - + InputSystem.brainIndexSchemeMap.delete(this._brainIndex) } /** Creates an instance of ArcadeDriveBehavior and automatically configures it. */ diff --git a/fission/src/ui/panels/configuring/initial-config/InitialConfigPanel.tsx b/fission/src/ui/panels/configuring/initial-config/InitialConfigPanel.tsx index 84e4dd30b..b4dd460fc 100644 --- a/fission/src/ui/panels/configuring/initial-config/InitialConfigPanel.tsx +++ b/fission/src/ui/panels/configuring/initial-config/InitialConfigPanel.tsx @@ -33,28 +33,8 @@ const InitialConfigPanel: React.FC = ({ panelId }) => { useEffect(() => { closePanel("import-mirabuf") - - /** If the panel is closed before a scheme is selected, defaults to the top of the list */ - if (targetAssembly?.miraType == MiraType.ROBOT) { - return () => { - const brainIndex = SynthesisBrain.GetBrainIndex(targetAssembly) - - if (brainIndex == undefined) return - - if (InputSystem.brainIndexSchemeMap.has(brainIndex)) return - - const scheme = InputSchemeManager.availableInputSchemes[0] - - InputSystem.brainIndexSchemeMap.set(brainIndex, scheme) - - setSelectedConfigurationType(ConfigurationType.INPUTS) - setSelectedScheme(scheme) - } - } else { - return () => {} - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [targetAssembly]) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) const closeFinish = useCallback(() => { if (targetAssembly?.miraType == MiraType.ROBOT) {