Fixes the terminal spamming POST requests on resize

Forgot to debounce the initial implementation
This commit is contained in:
Simon Howe
2016-11-03 22:16:29 +01:00
parent 7e5166e45e
commit 6c31f2ad60
+2 -1
View File
@@ -4,6 +4,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import classNames from 'classnames';
import _ from 'lodash';
import { clickCloseTerminal } from '../actions/app-actions';
import { getNeutralColor } from '../utils/color-utils';
@@ -203,7 +204,7 @@ class Terminal extends React.Component {
const {characterWidth, characterHeight} = terminalCellSize(this.term.element);
window.addEventListener('resize', this.handleResize);
window.addEventListener('resize', _.debounce(this.handleResize, 500));
this.resizeTimeout = setTimeout(() => {
this.setState({