mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 01:57:29 +00:00
Revert "Handle the case where positions might be an empty object to begin with"
This reverts commit f8544ed126.
This commit is contained in:
parent
0fd5908abf
commit
6cfbfa20b5
2 changed files with 7 additions and 8 deletions
|
|
@ -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())
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue