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