fix(elements): change data from outside

This commit is contained in:
moklick
2019-07-17 17:34:42 +02:00
parent a5aa78f02a
commit 1dbeebfb27
8 changed files with 59 additions and 33 deletions
+6 -3
View File
@@ -36,8 +36,8 @@ export const reducer = (state, action) => {
...state,
nodes: state.nodes.map((n) => {
if (n.data.id === action.payload.id) {
n.data = {
...n.data,
n.__rg = {
...n.__rg,
...action.payload.data
};
}
@@ -50,7 +50,10 @@ export const reducer = (state, action) => {
...state,
nodes: state.nodes.map((n) => {
if (n.data.id === action.payload.id) {
n.position = action.payload.pos;
n.__rg = {
...n.__rg,
position: action.payload.pos
};
}
return n;