changed naming and streamlined connections

This commit is contained in:
peterkogo
2024-06-24 16:37:11 +02:00
parent bedd05663e
commit 44254648c8
15 changed files with 129 additions and 124 deletions
+15 -8
View File
@@ -307,18 +307,25 @@ const createStore = ({
options
);
},
cancelConnection: () =>
cancelConnection: () => {
const { connection } = get();
set({
connectionStatus: null,
connectionStartHandle: null,
connectionEndHandle: null,
}),
connection: {
position: connection.position,
fromHandle: null,
toHandle: null,
isValid: null,
},
});
},
updateConnection: (params) => {
const { connectionPosition } = get();
const { connection } = get();
const currentConnection = {
...params,
connectionPosition: params.connectionPosition ?? connectionPosition,
connection: {
...params,
position: params.position ?? connection.position,
},
};
set(currentConnection);