Skip to content

Commit

Permalink
improved comparison robustness using lodash isEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed May 7, 2021
1 parent d72cf36 commit d980af9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/client/plugins/FeatureEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import {connect} from 'react-redux';
import {createSelector, createStructuredSelector} from 'reselect';
import {bindActionCreators} from 'redux';
import { get, pick } from 'lodash';
import { get, pick, isEqual } from 'lodash';
import {compose, lifecycle} from 'recompose';
import ReactDock from 'react-dock';

Expand Down Expand Up @@ -276,7 +276,7 @@ const EditorPlugin = compose(
componentDidUpdate(oldProps) {
const newOptions = pick(this.props, ['showFilteredObject', 'showTimeSync', 'timeSync', 'customEditorsOptions']);
const oldOptions = pick(oldProps, ['showFilteredObject', 'showTimeSync', 'timeSync', 'customEditorsOptions']);
if (JSON.stringify(newOptions) !== JSON.stringify(oldOptions) ) {
if (!isEqual(newOptions, oldOptions) ) {
this.props.onMount(newOptions);
}
}
Expand Down

0 comments on commit d980af9

Please sign in to comment.