diff --git a/__tests__/src/reducers/windows.test.js b/__tests__/src/reducers/windows.test.js index be79e54d6f..c3eb9c83a4 100644 --- a/__tests__/src/reducers/windows.test.js +++ b/__tests__/src/reducers/windows.test.js @@ -404,6 +404,7 @@ describe('windows reducer', () => { }, }; const action = { + collectionPath: [], type: ActionTypes.HIDE_COLLECTION_DIALOG, windowId: 'abc123', }; diff --git a/src/components/CollectionDialog.jsx b/src/components/CollectionDialog.jsx index 56067e263d..13e645529c 100644 --- a/src/components/CollectionDialog.jsx +++ b/src/components/CollectionDialog.jsx @@ -76,7 +76,7 @@ export function CollectionDialog({ /** */ const hideDialog = () => { - hideCollectionDialog(windowId); + hideCollectionDialog([...collectionPath, manifestId], windowId); }; /** */ diff --git a/src/containers/CollectionInfo.js b/src/containers/CollectionInfo.js index 6f737993e2..a4e5e129fa 100644 --- a/src/containers/CollectionInfo.js +++ b/src/containers/CollectionInfo.js @@ -13,7 +13,7 @@ import { CollectionInfo } from '../components/CollectionInfo'; * @memberof WindowSideBarInfoPanel * @private */ -const mapStateToProps = (state, { companionWindowId, windowId }) => { +const mapStateToProps = (state, { windowId }) => { const { collectionPath } = (getWindow(state, { windowId }) || {}); const manifestId = collectionPath[collectionPath.length - 1]; diff --git a/src/state/actions/window.js b/src/state/actions/window.js index e7ed508e11..7846a50adc 100644 --- a/src/state/actions/window.js +++ b/src/state/actions/window.js @@ -203,8 +203,9 @@ export function showCollectionDialog(manifestId, collectionPath = [], windowId) } /** */ -export function hideCollectionDialog(windowId) { +export function hideCollectionDialog(collectionPath = [], windowId) { return { + collectionPath, type: ActionTypes.HIDE_COLLECTION_DIALOG, windowId, }; diff --git a/src/state/reducers/windows.js b/src/state/reducers/windows.js index 33853fb8c7..a7a6721769 100644 --- a/src/state/reducers/windows.js +++ b/src/state/reducers/windows.js @@ -166,6 +166,7 @@ export const windowsReducer = (state = {}, action) => { [action.windowId]: { ...state[action.windowId], collectionDialogOn: false, + collectionPath: action.collectionPath, }, }; default: