AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(rnd): Add null checking & remove console logs on Input UI component (#7927)
Zamil Majdy6d17e627e8eb
diff --git a/rnd/autogpt_builder/src/components/CustomNode.tsx b/rnd/autogpt_builder/src/components/CustomNode.tsxindex dbe13cca3d..5cd1adbd11 100644--- a/rnd/autogpt_builder/src/components/CustomNode.tsx+++ b/rnd/autogpt_builder/src/components/CustomNode.tsx@@ -157,7 +157,7 @@ export function CustomNode({ data, id, width, height }: NodeProps<CustomNode>) {current[lastKey.key] = value;}- console.log(`Updating hardcoded values for node ${id}:`, newValues);+ // console.log(`Updating hardcoded values for node ${id}:`, newValues);if (!isInitialSetup.current) {history.push({diff --git a/rnd/autogpt_builder/src/components/ui/input.tsx b/rnd/autogpt_builder/src/components/ui/input.tsxindex 9b3044a282..96b7db4c01 100644--- a/rnd/autogpt_builder/src/components/ui/input.tsx+++ b/rnd/autogpt_builder/src/components/ui/input.tsx@@ -11,8 +11,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(// The HTMLvalue will only be updated if the value prop changes, but the user can still type in the input.ref = ref || React.createRef<HTMLInputElement>();React.useEffect(() => {- if (ref?.current?.value !== value) {- console.log("Value changed from", ref?.current?.value, "to", value);+ if (ref && ref.current && ref.current.value !== value) {ref.current.value = value;}}, [value]);