Skip to content
Snippets Groups Projects
Commit a9d4b59a authored by Camille Villa's avatar Camille Villa
Browse files

Allow multiple default companion windows


Co-Authored-By: default avatarChris Beer <chris@cbeer.info>
parent 45ee17af
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ export function addWindow(options) {
view: 'single',
maximized: false,
};
return { type: ActionTypes.ADD_WINDOW, window: { ...defaultOptions, ...options }, companionWindow: { id: cwDefault, position: 'left', content: 'info' } };
return { type: ActionTypes.ADD_WINDOW, window: { ...defaultOptions, ...options }, companionWindows: [{ id: cwDefault, position: 'left', content: 'info' }] };
}
/**
......
......@@ -10,7 +10,10 @@ export function companionWindowsReducer(state = {}, action) {
return setIn(state, [action.id], action.payload);
case ActionTypes.ADD_WINDOW:
return setIn(state, [action.companionWindow.id], action.companionWindow);
return action.companionWindows.reduce((newState, cw) => {
newState[cw.id] = cw; // eslint-disable-line no-param-reassign
return newState;
}, state);
case ActionTypes.UPDATE_COMPANION_WINDOW:
return updateIn(state, [action.id], orig => merge(orig, action.payload));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment