diff --git a/js/components/WindowManager.js b/js/components/WindowManager.js index 3189e11b..43576839 100644 --- a/js/components/WindowManager.js +++ b/js/components/WindowManager.js @@ -63,7 +63,7 @@ class WindowManager extends React.Component { y: Math.ceil(offsetTop + (globalOffsetTop + offset)) }; }); - this.props.updateWindowPositions(windowPositions, false); + this.props.updateWindowPositions(windowPositions); } else { // A layout has been suplied. We will compute the bounding box and // center the given layout. @@ -87,7 +87,7 @@ class WindowManager extends React.Component { {} ); - this.props.updateWindowPositions(newPositions, false); + this.props.updateWindowPositions(newPositions); } this.props.windowsHaveBeenCentered(); }; @@ -171,7 +171,7 @@ class WindowManager extends React.Component { return diff; }, {}); - this.props.updateWindowPositions(windowPositionDiff, false); + this.props.updateWindowPositions(windowPositionDiff); }; const removeListeners = () => { @@ -228,8 +228,8 @@ const mapStateToProps = state => ({ const mapDispatchToProps = dispatch => { return { - updateWindowPositions: (positions, centered) => - dispatch(updateWindowPositions(positions, centered)), + updateWindowPositions: positions => + dispatch(updateWindowPositions(positions)), windowsHaveBeenCentered: () => dispatch(windowsHaveBeenCentered()) }; }; diff --git a/js/reducers/windows.ts b/js/reducers/windows.ts index bf075f6a..e30158a8 100644 --- a/js/reducers/windows.ts +++ b/js/reducers/windows.ts @@ -198,11 +198,10 @@ const windows = ( } return { ...w, ...serializedW }; }), - // Note: We iterate genWindows here, since the positions object may be empty - positions: objectMap(state.genWindows, (position, windowId) => { + positions: objectMap(state.positions, (position, windowId) => { const serializedPosition = serializedPositions[windowId]; if (serializedPosition == null) { - return state.positions[windowId]; + return position; } return serializedPosition; }),