diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index b9de7f30c9..1d5c0d5637 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -462,7 +462,7 @@ class Editor extends React.Component { }; toggleQueryEditor = () => { - this.setState({ showQueryEditor: !this.state.showQueryEditor }); + this.setState((prev) => ({ showQueryEditor: !prev.showQueryEditor })); this.toolTipRefHide.current.style.display = this.state.showQueryEditor ? 'none' : 'flex'; this.toolTipRefShow.current.style.display = this.state.showQueryEditor ? 'flex' : 'none'; }; @@ -490,7 +490,7 @@ class Editor extends React.Component { }; toggleQuerySearch = () => { - this.setState({ showQuerySearchField: !this.state.showQuerySearchField }); + this.setState((prev) => ({ showQuerySearchField: !prev.showQuerySearchField })); }; onVersionDeploy = (versionId) => {