Skip to content

Commit e52eef5

Browse files
Implemented review comments.
1 parent 8795b7e commit e52eef5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

web/pgadmin/tools/erd/static/js/erd_tool/components/MainToolBar.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88
//////////////////////////////////////////////////////////////
99
import React, {useCallback, useEffect, useState} from 'react';
10+
import _ from 'lodash';
1011
import { styled } from '@mui/material/styles';
1112
import { Box, useTheme } from '@mui/material';
1213
import { PgButtonGroup, PgIconButton } from '../../../../../../static/js/components/Buttons';
@@ -164,7 +165,13 @@ export function MainToolBar({preferences, eventBus, fillColor, textColor, notati
164165
isDirtyRef.current = isDirty;
165166
setDisableButton('save', !isDirty);
166167
if((isDirty || fileName) && isSaveToolDataEnabled('ERD')){
167-
setSaveERDData({data, fileName, isDirty, toolbarPrefs});
168+
setSaveERDData((prev) => ({
169+
...prev,
170+
data,
171+
fileName,
172+
isDirty,
173+
...(toolbarPrefs !== undefined && { toolbarPrefs }),
174+
}));
168175
}
169176
}],
170177
];

0 commit comments

Comments
 (0)