diff --git a/frontend/app/components/shared/SessionListContainer/components/SessionList/SessionList.tsx b/frontend/app/components/shared/SessionListContainer/components/SessionList/SessionList.tsx index ec4c0cec9..d3c678c76 100644 --- a/frontend/app/components/shared/SessionListContainer/components/SessionList/SessionList.tsx +++ b/frontend/app/components/shared/SessionListContainer/components/SessionList/SessionList.tsx @@ -7,6 +7,7 @@ import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import { fetchSessions, addFilterByKeyAndValue, updateCurrentPage, setScrollPosition } from 'Duck/search'; import useTimeout from 'App/hooks/useTimeout'; import { numberWithCommas } from 'App/utils'; +import { fetchListActive as fetchMetadata } from 'Duck/customField'; const AUTOREFRESH_INTERVAL = 5 * 60 * 1000; const PER_PAGE = 10; @@ -23,6 +24,7 @@ interface Props { updateCurrentPage: (page: number) => void; setScrollPosition: (scrollPosition: number) => void; fetchSessions: (filters: any, force: boolean) => void; + fetchMetadata: () => void; activeTab: any; isEnterprise?: boolean; } @@ -53,8 +55,8 @@ function SessionList(props: Props) { useTimeout(() => { props.fetchSessions(null, true); }, AUTOREFRESH_INTERVAL); - - + + useEffect(() => { // handle scroll position const { scrollY } = props; @@ -62,7 +64,8 @@ function SessionList(props: Props) { if (total === 0) { props.fetchSessions(null, true); } - + props.fetchMetadata() + return () => { props.setScrollPosition(window.scrollY); }; @@ -148,5 +151,5 @@ export default connect( activeTab: state.getIn(['search', 'activeTab']), isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee', }), - { updateCurrentPage, addFilterByKeyAndValue, setScrollPosition, fetchSessions } + { updateCurrentPage, addFilterByKeyAndValue, setScrollPosition, fetchSessions, fetchMetadata } )(SessionList);