Skip to content

Commit

Permalink
remove extra calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Jun 2, 2021
1 parent 94c0bd3 commit 8ddaf82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/components/theme/View/CollectionView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module components/theme/View/CollectionView
*/

import React, { useState, useRef, useEffect } from 'react';
import React, { useState, useEffect } from 'react';
import { Helmet } from '@plone/volto/helpers';
import { Container, Item } from 'semantic-ui-react';
import { useSelector, useDispatch } from 'react-redux';
Expand Down Expand Up @@ -59,6 +59,7 @@ const CollectionView = (props) => {
const listingBlockid = getListingBlock();

const listingBlockItems = useSelector((state) => state.content.subrequests);
const items = listingBlockItems[listingBlockid]?.data?.items;

useEffect(() => {
//This is only done to get full expanded content along with metadata fields which is,
Expand All @@ -70,7 +71,7 @@ const CollectionView = (props) => {
fullobjects: true,
};
dispatch(getContentWithData(path, null, listingBlockid, options));
}, []);
}, [dispatch, path, listingBlockid]);

const handleSelectFilter = (ev, { name }) => {
setActiveFilter(name);
Expand Down Expand Up @@ -104,10 +105,10 @@ const CollectionView = (props) => {
</p>
)}
<div className={cx('block listing', listingBlockProps.variation)}>
{listingBlockItems ? (
{items ? (
<>
<ListingBlockTemplate
items={listingBlockItems[listingBlockid]?.data?.items}
items={items}
{...listingBlockProps}
isEditMode={false}
/>
Expand Down
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export default function applyConfig(config) {
'localnavigation',
],
},
{
match: '',
GET_QUERYSTRING_RESULTS: ['breadcrumbs'],
},
],
navDepth: 4,
allowed_cors_destinations,
Expand Down

0 comments on commit 8ddaf82

Please sign in to comment.