Skip to content

Commit

Permalink
fix(ui): pending node connection stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Aug 28, 2024
1 parent 5db7b48 commit 9692a5f
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { IAINoContentFallback } from 'common/components/IAIImageFallback';
import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent';
import { useBuildNode } from 'features/nodes/hooks/useBuildNode';
import {
$addNodeCmdk,
$cursorPos,
$edgePendingUpdate,
$pendingConnection,
Expand Down Expand Up @@ -175,21 +174,20 @@ export const AddNodeCmdk = memo(() => {
setSearchTerm(e.target.value);
}, []);

const onSelect = useCallback(
(value: string) => {
addNode(value);
$addNodeCmdk.set(false);
setSearchTerm('');
},
[addNode]
);

const onClose = useCallback(() => {
addNodeCmdk.setFalse();
setSearchTerm('');
$pendingConnection.set(null);
}, [addNodeCmdk]);

const onSelect = useCallback(
(value: string) => {
addNode(value);
onClose();
},
[addNode, onClose]
);

return (
<Modal
isOpen={addNodeCmdkIsOpen}
Expand Down

0 comments on commit 9692a5f

Please sign in to comment.