fix: reset undo/redo actions on version change (#2574)

This commit is contained in:
Gandharv 2022-03-24 21:01:24 +05:00 committed by GitHub
parent 8a6df632d2
commit c974373f06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,9 +130,6 @@ class Editor extends React.Component {
};
this.autoSave = debounce(this.saveEditingVersion, 3000);
// setup for closing versions dropdown on oustide click
this.wrapperRef = React.createRef();
}
setWindowTitle(name) {
@ -343,6 +340,7 @@ class Editor extends React.Component {
this.fetchDataSources();
this.fetchDataQueries();
this.initComponentVersioning();
};
dataSourcesChanged = () => {
@ -456,12 +454,6 @@ class Editor extends React.Component {
this.setState({ slug: newSlug });
};
handleClickOutsideAppVersionsDropdown = (event) => {
if (this.wrapperRef && !this.wrapperRef.current.contains(event.target)) {
this.setState({ showAppVersionsDropdown: false });
}
};
removeComponent = (component) => {
if (!this.isVersionReleased()) {
let newDefinition = cloneDeep(this.state.appDefinition);