X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/6cb43ce8d9ab8345a1b2a5abd961c7c134f5c607..3c2e32130d4229eada68f21d4000da9a0f844ba4:/src/store/collection-panel/collection-panel-reducer.ts diff --git a/src/store/collection-panel/collection-panel-reducer.ts b/src/store/collection-panel/collection-panel-reducer.ts index 0dd233ea..18590181 100644 --- a/src/store/collection-panel/collection-panel-reducer.ts +++ b/src/store/collection-panel/collection-panel-reducer.ts @@ -3,19 +3,26 @@ // SPDX-License-Identifier: AGPL-3.0 import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action"; -import { CollectionResource } from "../../models/collection"; +import { CollectionResource } from "~/models/collection"; export interface CollectionPanelState { item: CollectionResource | null; + loadBigCollections: boolean; } const initialState = { - item: null + item: null, + loadBigCollections: false, }; export const collectionPanelReducer = (state: CollectionPanelState = initialState, action: CollectionPanelAction) => collectionPanelActions.match(action, { default: () => state, - LOAD_COLLECTION: () => state, + SET_COLLECTION: (item) => ({ + ...state, + item, + loadBigCollections: false, + }), LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }), + LOAD_BIG_COLLECTIONS: (loadBigCollections) => ({ ...state, loadBigCollections}), });