refactor(core): cleanup useHandle and set status on actions

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-06 01:13:13 +01:00
committed by Braks
parent 3d958dfe4f
commit 619f4bf3e7
3 changed files with 7 additions and 7 deletions
+5 -1
View File
@@ -429,6 +429,8 @@ export function useActions(state: State, getters: ComputedGetters): Actions {
state.connectionStartHandle = startHandle
}
state.connectionStatus = null
if (position) state.connectionPosition = position
state.hooks.connectStart.trigger({
@@ -439,12 +441,14 @@ export function useActions(state: State, getters: ComputedGetters): Actions {
})
}
const updateConnection: Actions['updateConnection'] = (position) => {
const updateConnection: Actions['updateConnection'] = (position, status = null) => {
state.connectionPosition = position
state.connectionStatus = status
}
const endConnection: Actions['endConnection'] = (event, isClick) => {
state.connectionPosition = { x: NaN, y: NaN }
state.connectionStatus = null
if (isClick) {
state.connectionClickStartHandle = null