Skip to content

Commit

Permalink
feat: update existing params on blur
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Jul 1, 2024
1 parent 0e7ddb3 commit 6031065
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions components/edit/configure/params.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ const Imports: React.FC<ExternalProps> = ({params, setParams, className, descrip
placeholder="Name..."
className="w-1/3"
variant="bordered"
value={param}
onChange={(e) => {
defaultValue={param}
onBlur={(e) => {
const target = e.target as HTMLInputElement;
const updatedParams = { ...params };
updatedParams[e.target.value] = updatedParams[param];
updatedParams[target.value] = updatedParams[param];
delete updatedParams[param];
setParams(updatedParams);
}}
Expand Down
1 change: 0 additions & 1 deletion components/script/useChatSocket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { CallFrame, PromptFrame, PromptResponse, AuthResponse} from '@gptsc
import { Message, MessageType } from './messages';
import PromptForm from './messages/promptForm';
import ConfirmForm from './messages/confirmForm';
import { initial } from 'lodash';

const useChatSocket = (isEmpty?: boolean) => {
// State
Expand Down

0 comments on commit 6031065

Please sign in to comment.