mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
save fix
This commit is contained in:
parent
e8ffaaab6f
commit
96a52750e2
@ -49,22 +49,26 @@ export default function Designer({ value, onChange }) {
|
||||
|
||||
const bringToFront = React.useCallback(
|
||||
(table) => {
|
||||
onChange((current) => ({
|
||||
...current,
|
||||
tables: [...(current.tables || []).filter((x) => x.designerId != table.designerId), table],
|
||||
}));
|
||||
const newValue = {
|
||||
...value,
|
||||
tables: [...(value.tables || []).filter((x) => x.designerId != table.designerId), table],
|
||||
};
|
||||
|
||||
onChange(newValue);
|
||||
},
|
||||
[onChange]
|
||||
[onChange, value]
|
||||
);
|
||||
|
||||
const removeTable = React.useCallback(
|
||||
(table) => {
|
||||
onChange((current) => ({
|
||||
...current,
|
||||
tables: (current.tables || []).filter((x) => x.designerId != table.designerId),
|
||||
}));
|
||||
const newValue = {
|
||||
...value,
|
||||
tables: (value.tables || []).filter((x) => x.designerId != table.designerId),
|
||||
};
|
||||
|
||||
onChange(newValue);
|
||||
},
|
||||
[onChange]
|
||||
[onChange, value]
|
||||
);
|
||||
|
||||
return (
|
||||
|
@ -11,6 +11,8 @@ function getParsedLocalStorage(key) {
|
||||
const res = JSON.parse(value);
|
||||
return res;
|
||||
} catch (e) {
|
||||
// console.log('FAILED LOAD FROM STORAGE', e);
|
||||
// console.log('VALUE', value);
|
||||
localStorage.removeItem(key);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user