Skip to content

Commit 08b2fad

Browse files
committed
add deep comparison
1 parent 18b3d85 commit 08b2fad

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"core-js": "3.41.0",
4747
"csurf": "1.11.0",
4848
"express": "4.21.2",
49+
"fast-deep-equal": "3.1.3",
4950
"graphiql": "2.0.8",
5051
"graphql": "16.11.0",
5152
"immutable": "5.1.2",

src/dashboard/Data/Config/Config.react.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Toolbar from 'components/Toolbar/Toolbar.react';
2222
import browserStyles from 'dashboard/Data/Browser/Browser.scss';
2323
import { CurrentApp } from 'context/currentApp';
2424
import Modal from 'components/Modal/Modal.react';
25+
import equal from 'fast-deep-equal';
2526

2627
@subscribeTo('Config', 'config')
2728
class Config extends TableView {
@@ -281,8 +282,9 @@ class Config extends TableView {
281282
await this.props.config.dispatch(ActionTypes.FETCH);
282283
const fetchedParamsAfter = this.props.config.data.get('params');
283284
const currentValueAfter = fetchedParamsAfter.get(name);
285+
const valuesAreEqual = equal(currentValue, currentValueAfter);
284286

285-
if (currentValue !== currentValueAfter && !override) {
287+
if (!valuesAreEqual && !override) {
286288
this.setState({
287289
confirmModalOpen: true,
288290
modalOpen: false,

0 commit comments

Comments
 (0)