diff --git a/js/components/WindowManager.jsx b/js/components/WindowManager.jsx index 19083d4f..d7c2a6c5 100644 --- a/js/components/WindowManager.jsx +++ b/js/components/WindowManager.jsx @@ -11,11 +11,18 @@ class WindowManager extends React.Component { super(props); this.windowNodes = []; this.state = {}; - window.addEventListener('resize', this.centerWindows.bind(this)); this.getRef = this.getRef.bind(this); this.handleMouseDown = this.handleMouseDown.bind(this); } + componentDidMount() { + window.addEventListener('resize', this.centerWindows.bind(this)); + const {innerHeight, innerWidth} = window; + if (innerHeight || innerWidth) { + this.centerWindows(); + } + } + centerWindows() { const {innerHeight, innerWidth} = window; const state = {};