change(ui) - assist sort by first meta
This commit is contained in:
parent
3c9a96e7ab
commit
625176df97
4 changed files with 13 additions and 5 deletions
|
|
@ -51,6 +51,7 @@ const Header = (props) => {
|
|||
Promise.all([
|
||||
userStore.fetchLimits(),
|
||||
notificationStore.fetchNotificationsCount(),
|
||||
props.fetchMetadata(),
|
||||
]).then(() => {
|
||||
userStore.updateKey('initialDataFetched', true);
|
||||
});
|
||||
|
|
@ -60,7 +61,6 @@ const Header = (props) => {
|
|||
useEffect(() => {
|
||||
activeSite = sites.find(s => s.id == siteId);
|
||||
props.initSite(activeSite);
|
||||
props.fetchMetadata();
|
||||
}, [siteId])
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import styles from './siteDropdown.module.css';
|
|||
import cn from 'classnames';
|
||||
import NewSiteForm from '../Client/Sites/NewSiteForm';
|
||||
import { clearSearch } from 'Duck/search';
|
||||
import { clearSearch as clearSearchLive } from 'Duck/liveSearch';
|
||||
import { fetchList as fetchIntegrationVariables } from 'Duck/customField';
|
||||
import { withStore } from 'App/mstore'
|
||||
import AnimatedSVG, { ICONS } from '../shared/AnimatedSVG/AnimatedSVG';
|
||||
|
|
@ -27,6 +28,7 @@ import NewProjectButton from './NewProjectButton';
|
|||
pushNewSite,
|
||||
init,
|
||||
clearSearch,
|
||||
clearSearchLive,
|
||||
fetchIntegrationVariables,
|
||||
})
|
||||
export default class SiteDropdown extends React.PureComponent {
|
||||
|
|
@ -45,8 +47,9 @@ export default class SiteDropdown extends React.PureComponent {
|
|||
const { mstore, location } = this.props
|
||||
|
||||
this.props.setSiteId(siteId);
|
||||
this.props.clearSearch(location.pathname.includes('/sessions'));
|
||||
this.props.fetchIntegrationVariables();
|
||||
this.props.clearSearch(location.pathname.includes('/sessions'));
|
||||
this.props.clearSearchLive();
|
||||
|
||||
mstore.initClient();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,12 +46,17 @@ function LiveSessionList(props: Props) {
|
|||
})).toJS());
|
||||
|
||||
useEffect(() => {
|
||||
props.applyFilter({ ...filter });
|
||||
if (metaListLoading) return;
|
||||
const _filter = { ...filter };
|
||||
if (sortOptions[1]) {
|
||||
_filter.sort = sortOptions[1].value;
|
||||
}
|
||||
props.applyFilter(_filter);
|
||||
timeout();
|
||||
return () => {
|
||||
clearTimeout(timeoutId);
|
||||
};
|
||||
}, []);
|
||||
}, [metaListLoading]);
|
||||
|
||||
const onUserClick = (userId: string, userAnonymousId: string) => {
|
||||
if (userId) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export const fetchSessions = (filter) => (dispatch, getState) => {
|
|||
};
|
||||
|
||||
export const clearSearch = () => (dispatch, getState) => {
|
||||
dispatch(edit(new Filter({ filters: [] })));
|
||||
dispatch(edit(new Filter({ filters: [], sort: 'timestamp' })));
|
||||
return dispatch({
|
||||
type: CLEAR_SEARCH,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue