diff --git a/js/components/WindowManager.js b/js/components/WindowManager.js index c2f9330f..4ea4fa40 100644 --- a/js/components/WindowManager.js +++ b/js/components/WindowManager.js @@ -132,17 +132,7 @@ class WindowManager extends React.Component { ) }; - let box; - try { - box = boundingBox(moving); - } catch (err) { - console.error( - `Could not construct bounding box for key: ${key}. moving.length is: ${ - moving.length - }` - ); - throw err; - } + const box = boundingBox(moving); const handleMouseMove = ee => { const proposedDiff = { diff --git a/js/reducers/windows.js b/js/reducers/windows.js index 34a1376d..6e4cf34d 100644 --- a/js/reducers/windows.js +++ b/js/reducers/windows.js @@ -77,13 +77,16 @@ const windows = (state = defaultWindowsState, action) => { } }; case TOGGLE_WINDOW: + const windowState = state.genWindows[action.windowId]; return { ...state, genWindows: { ...state.genWindows, [action.windowId]: { - ...state.genWindows[action.windowId], - open: !state.genWindows[action.windowId].open + ...windowState, + open: !windowState.open, + // Reset hidden state when opening window + hidden: windowState.open ? windowState.hidden : false } } };