Reset hidden state when opening window

Fixes #626
This commit is contained in:
Jordan Eldredge 2018-07-29 21:36:44 -07:00
parent e89680fb48
commit 3ef93e28ab
2 changed files with 6 additions and 13 deletions

View file

@ -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 = {

View file

@ -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
}
}
};