Skip to content

Commit d0cb2fb

Browse files
towerofnixbenjiwheeler
authored andcommitted
Remove unused dimensions info from metrics reducer
1 parent 5f68aa4 commit d0cb2fb

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/containers/target-pane.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ class TargetPane extends React.Component {
177177

178178
// Determine position of the top-level block based on the target's workspace metrics.
179179
const {scrollX, scrollY, scale} = metrics;
180-
const {width} = this.props.workspaceMetrics.dimensions;
181180
const posY = -scrollY + 30;
182181
let posX;
183182
if (this.props.isRtl) {

src/reducers/workspace-metrics.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
const UPDATE_DIMENSIONS = 'scratch-gui/workspace-metrics/UPDATE_DIMENSIONS';
21
const UPDATE_METRICS = 'scratch-gui/workspace-metrics/UPDATE_METRICS';
32

43
const initialState = {
5-
dimensions: {
6-
width: 0,
7-
height: 0
8-
},
94
targets: {}
105
};
116

127
const reducer = function (state, action) {
138
if (typeof state === 'undefined') state = initialState;
149

1510
switch (action.type) {
16-
case UPDATE_DIMENSIONS:
17-
return Object.assign({}, state, {
18-
dimensions: {
19-
width: action.width,
20-
height: action.height
21-
}
22-
});
2311
case UPDATE_METRICS:
2412
return Object.assign({}, state, {
2513
targets: Object.assign({}, state.targets, {
@@ -35,13 +23,6 @@ const reducer = function (state, action) {
3523
}
3624
};
3725

38-
const updateDimensions = function (dimensions) {
39-
return {
40-
type: UPDATE_DIMENSIONS,
41-
...dimensions
42-
};
43-
};
44-
4526
const updateMetrics = function (metrics) {
4627
return {
4728
type: UPDATE_METRICS,

0 commit comments

Comments
 (0)