Skip to content
Snippets Groups Projects
Commit ded05d8f authored by Mathias Maaß's avatar Mathias Maaß
Browse files

Remove viewer state out of window state

parent 157a4832
No related branches found
No related tags found
No related merge requests found
...@@ -230,27 +230,4 @@ describe('windows reducer', () => { ...@@ -230,27 +230,4 @@ describe('windows reducer', () => {
}, },
}); });
}); });
it('should handle UPDATE_VIEWPORT', () => {
expect(windowsReducer({
abc123: {
id: 'abc123',
},
def456: {
id: 'def456',
},
}, {
type: ActionTypes.UPDATE_VIEWPORT,
windowId: 'abc123',
payload: { x: 0, y: 1, zoom: 0.5 },
})).toEqual({
abc123: {
id: 'abc123',
viewer: { x: 0, y: 1, zoom: 0.5 },
},
def456: {
id: 'def456',
},
});
});
}); });
...@@ -67,14 +67,6 @@ export const windowsReducer = (state = {}, action) => { ...@@ -67,14 +67,6 @@ export const windowsReducer = (state = {}, action) => {
return setCanvasIndex(state, action.windowId, currentIndex => currentIndex - 1); return setCanvasIndex(state, action.windowId, currentIndex => currentIndex - 1);
case ActionTypes.SET_CANVAS: case ActionTypes.SET_CANVAS:
return setCanvasIndex(state, action.windowId, currentIndex => action.canvasIndex); return setCanvasIndex(state, action.windowId, currentIndex => action.canvasIndex);
case ActionTypes.UPDATE_VIEWPORT:
return {
...state,
[action.windowId]: {
...state[action.windowId],
viewer: action.payload,
},
};
default: default:
return state; return state;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment