Skip to content

Commit

Permalink
Revert "Use the query parameters hasher in useUpdateMonitorSettings"
Browse files Browse the repository at this point in the history
This reverts commit 4e246c0.
  • Loading branch information
cleacos committed Aug 30, 2024
1 parent c4de38a commit 7eae1ab
Showing 1 changed file with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useTranslate } from 'i18n-calypso';
import { useCallback, useState, useContext } from 'react';
import { getSelectedFilters } from 'calypso/a8c-for-agencies/sections/sites/sites-dashboard/get-selected-filters';
import SitesDashboardContext from 'calypso/a8c-for-agencies/sections/sites/sites-dashboard-context';
import { hashParameters } from 'calypso/data/agency-dashboard/use-fetch-dashboard-sites';
import isA8CForAgencies from 'calypso/lib/a8c-for-agencies/is-a8c-for-agencies';
import { useDispatch, useSelector } from 'calypso/state';
import { getActiveAgencyId } from 'calypso/state/a8c-for-agencies/agency/selectors';
Expand All @@ -29,36 +28,30 @@ export default function useUpdateMonitorSettings(
const queryClient = useQueryClient();
const { filter, search, currentPage, sort } = useContext( SitesOverviewContext );

const { dataViewsState, showOnlyFavorites, showOnlyDevelopmentSites } =
useContext( SitesDashboardContext );
const { dataViewsState, showOnlyFavorites } = useContext( SitesDashboardContext );

const agencyId = useSelector( getActiveAgencyId );

const queryKey = isA8CForAgencies()
? [
'jetpack-agency-dashboard-sites',
hashParameters( [
dataViewsState.search,
dataViewsState.page,
{
issueTypes: getSelectedFilters( dataViewsState.filters ),
showOnlyFavorites: showOnlyFavorites || false,
showOnlyDevelopmentSites: showOnlyDevelopmentSites || false,
},
dataViewsState.sort,
dataViewsState.perPage,
...( agencyId ? [ agencyId ] : [] ),
] ),
dataViewsState.search,
dataViewsState.page,
{
issueTypes: getSelectedFilters( dataViewsState.filters ),
showOnlyFavorites: showOnlyFavorites || false,
},
dataViewsState.sort,
dataViewsState.perPage,
...( agencyId ? [ agencyId ] : [] ),
]
: [
'jetpack-agency-dashboard-sites',
hashParameters( [
search,
currentPage,
filter,
sort,
...( agencyId ? [ agencyId ] : [] ),
] ),
search,
currentPage,
filter,
sort,
...( agencyId ? [ agencyId ] : [] ),
];

const [ status, setStatus ] = useState( 'idle' );
Expand Down

0 comments on commit 7eae1ab

Please sign in to comment.