mirror of
https://github.com/Significant-Gravitas/Auto-GPT.git
synced 2025-01-08 11:57:32 +08:00
Revert node-input-components.tsx
This commit is contained in:
parent
2f8b607b1c
commit
0eee741002
@ -10,7 +10,7 @@ import {
|
||||
BlockIONumberSubSchema,
|
||||
BlockIOBooleanSubSchema,
|
||||
} from "@/lib/autogpt-server-api/types";
|
||||
import { FC, useCallback, useEffect, useState } from "react";
|
||||
import { FC, useEffect, useState } from "react";
|
||||
import { Button } from "./ui/button";
|
||||
import { Switch } from "./ui/switch";
|
||||
import {
|
||||
@ -296,7 +296,7 @@ const NodeKeyValueInput: FC<{
|
||||
className,
|
||||
displayName,
|
||||
}) => {
|
||||
const getPairValues = useCallback(() => {
|
||||
const getPairValues = () => {
|
||||
let defaultEntries = new Map<string, any>();
|
||||
|
||||
connections
|
||||
@ -311,7 +311,7 @@ const NodeKeyValueInput: FC<{
|
||||
});
|
||||
|
||||
return Array.from(defaultEntries, ([key, value]) => ({ key, value }));
|
||||
}, [connections, entries, schema.default, selfKey]);
|
||||
};
|
||||
|
||||
const [keyValuePairs, setKeyValuePairs] = useState<
|
||||
{ key: string; value: string | number | null }[]
|
||||
@ -319,7 +319,7 @@ const NodeKeyValueInput: FC<{
|
||||
|
||||
useEffect(
|
||||
() => setKeyValuePairs(getPairValues()),
|
||||
[connections, entries, schema.default, getPairValues],
|
||||
[connections, entries, schema.default],
|
||||
);
|
||||
|
||||
function updateKeyValuePairs(newPairs: typeof keyValuePairs) {
|
||||
|
Loading…
Reference in New Issue
Block a user