mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
posting node updates flow
This commit is contained in:
parent
f71be36520
commit
fbd64dec4c
2 changed files with 14 additions and 1 deletions
|
@ -46,7 +46,18 @@ function* onNodeSave({ node }: ReturnType<typeof nodeSave>) {
|
|||
}
|
||||
|
||||
const nodes = yield select(selectFlowNodes);
|
||||
yield put(flowSetNodes([result, ...nodes]));
|
||||
const updated_flow_nodes = node.id
|
||||
? nodes.map(item => (item.id === result.id ? result : item))
|
||||
: [result, ...nodes];
|
||||
|
||||
yield put(flowSetNodes(updated_flow_nodes));
|
||||
|
||||
const { current } = yield select(selectNode);
|
||||
|
||||
if (node.id && current.id === result.id) {
|
||||
yield put(nodeSetCurrent(result));
|
||||
}
|
||||
|
||||
return yield put(modalSetShown(false));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue