Skip to content

Commit

Permalink
Do not bind multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
koszti committed Jul 7, 2021
1 parent cda7c0e commit efb86e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superset-frontend/src/SqlLab/components/SqlEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class SqlEditor extends React.PureComponent {
this.setState({ height: this.getSqlEditorHeight() });

window.addEventListener('resize', this.handleWindowResize);
window.addEventListener('beforeunload', this.onBeforeUnload.bind(this));
window.addEventListener('beforeunload', this.onBeforeUnload);

// setup hotkeys
const hotkeys = this.getHotkeyConfig();
Expand All @@ -224,7 +224,7 @@ class SqlEditor extends React.PureComponent {

componentWillUnmount() {
window.removeEventListener('resize', this.handleWindowResize);
window.removeEventListener('beforeunload', this.onBeforeUnload.bind(this));
window.removeEventListener('beforeunload', this.onBeforeUnload);
}

onResizeStart() {
Expand Down

0 comments on commit efb86e5

Please sign in to comment.