fix(ui): pending node connection stuck

This commit is contained in:
psychedelicious 2024-08-28 22:05:03 +10:00
parent 3c2fa6b475
commit 55fe1ebc53

View File

@ -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,
@ -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}