fix designer save

This commit is contained in:
Jan Prochazka
2020-12-26 14:23:04 +01:00
parent a18f98bf28
commit e8ffaaab6f
2 changed files with 10 additions and 10 deletions

View File

@@ -38,12 +38,13 @@ export default function Designer({ value, onChange }) {
const changeTable = React.useCallback(
(table) => {
onChange((current) => ({
...current,
tables: (current.tables || []).map((x) => (x.designerId == table.designerId ? table : x)),
}));
const newValue = {
...value,
tables: (value.tables || []).map((x) => (x.designerId == table.designerId ? table : x)),
};
onChange(newValue);
},
[onChange]
[onChange, value]
);
const bringToFront = React.useCallback(