mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): duplicated edges when updating edge with lazy connect
This commit is contained in:
parent
6b11740dda
commit
504ac82077
@ -2,11 +2,13 @@ import { useStore } from '@nanostores/react';
|
||||
import { useAppStore } from 'app/store/storeHooks';
|
||||
import { $mouseOverNode } from 'features/nodes/hooks/useMouseOverNode';
|
||||
import {
|
||||
$didUpdateEdge,
|
||||
$edgePendingUpdate,
|
||||
$isAddNodePopoverOpen,
|
||||
$pendingConnection,
|
||||
$templates,
|
||||
connectionMade,
|
||||
edgeDeleted,
|
||||
} from 'features/nodes/store/nodesSlice';
|
||||
import { getFirstValidConnection } from 'features/nodes/store/util/getFirstValidConnection';
|
||||
import { isString } from 'lodash-es';
|
||||
@ -93,6 +95,10 @@ export const useConnection = () => {
|
||||
dispatch(connectionMade(connection));
|
||||
const nodesToUpdate = [connection.source, connection.target].filter(isString);
|
||||
updateNodeInternals(nodesToUpdate);
|
||||
if (edgePendingUpdate) {
|
||||
dispatch(edgeDeleted(edgePendingUpdate.id));
|
||||
$didUpdateEdge.set(true);
|
||||
}
|
||||
}
|
||||
$pendingConnection.set(null);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user