X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f0ac109691369516a5adf9370838cb4eacf16a45..cf83b358f087a87b5ff095d3ed7a8c6920c60ffe:/src/store/collection-panel/collection-panel-reducer.ts?ds=inline diff --git a/src/store/collection-panel/collection-panel-reducer.ts b/src/store/collection-panel/collection-panel-reducer.ts index 2c3edf1a5a..18590181fb 100644 --- a/src/store/collection-panel/collection-panel-reducer.ts +++ b/src/store/collection-panel/collection-panel-reducer.ts @@ -4,23 +4,25 @@ import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action"; import { CollectionResource } from "~/models/collection"; -import { TagResource } from "~/models/tag"; export interface CollectionPanelState { item: CollectionResource | null; - tags: TagResource[]; + loadBigCollections: boolean; } const initialState = { item: null, - tags: [] + loadBigCollections: false, }; export const collectionPanelReducer = (state: CollectionPanelState = initialState, action: CollectionPanelAction) => collectionPanelActions.match(action, { default: () => state, + SET_COLLECTION: (item) => ({ + ...state, + item, + loadBigCollections: false, + }), LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }), - LOAD_COLLECTION_TAGS_SUCCESS: ({ tags }) => ({...state, tags }), - CREATE_COLLECTION_TAG_SUCCESS: ({ tag }) => ({...state, tags: [...state.tags, tag] }), - DELETE_COLLECTION_TAG_SUCCESS: ({ uuid }) => ({...state, tags: state.tags.filter(tag => tag.uuid !== uuid) }) + LOAD_BIG_COLLECTIONS: (loadBigCollections) => ({ ...state, loadBigCollections}), });