1
0
Fork 0
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:
Fedor Katurov 2019-10-22 13:01:31 +07:00
parent f71be36520
commit fbd64dec4c
2 changed files with 14 additions and 1 deletions

View file

@ -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));
}