fix(sql lab): Selecting edit on a query from query history doesn't update the SQL Editor properly (#19290)

This commit is contained in:
Diego Medina
2022-04-15 14:49:32 -04:00
committed by GitHub
parent 56381f4ee8
commit bbe0af348b
2 changed files with 18 additions and 4 deletions

View File

@@ -240,6 +240,12 @@ class SqlEditor extends React.PureComponent {
});
}
componentDidUpdate() {
if (this.props.queryEditor.sql !== this.state.sql) {
this.onSqlChanged(this.props.queryEditor.sql);
}
}
componentWillUnmount() {
window.removeEventListener('resize', this.handleWindowResize);
window.removeEventListener('beforeunload', this.onBeforeUnload);