fix count with opportunities page (#1839)

* fix count with opportunities page

* make unscoped atom entityCountInCurrentViewState
This commit is contained in:
Tom Avalexing
2023-10-04 16:04:53 +03:00
committed by GitHub
parent 46dffeadef
commit 56eea72110
4 changed files with 30 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import { useRecoilScopeId } from '@/ui/utilities/recoil-scope/hooks/useRecoilSco
import { availableFiltersScopedState } from '@/ui/view-bar/states/availableFiltersScopedState';
import { availableSortsScopedState } from '@/ui/view-bar/states/availableSortsScopedState';
import { currentViewIdScopedState } from '@/ui/view-bar/states/currentViewIdScopedState';
import { entityCountInCurrentViewState } from '@/ui/view-bar/states/entityCountInCurrentViewState';
import { filtersScopedState } from '@/ui/view-bar/states/filtersScopedState';
import { savedFiltersFamilyState } from '@/ui/view-bar/states/savedFiltersFamilyState';
import { savedSortsFamilyState } from '@/ui/view-bar/states/savedSortsFamilyState';
@ -41,6 +42,10 @@ export const HooksCompanyBoardEffect = () => {
CompanyBoardRecoilScopeContext,
);
const [, setEntityCountInCurrentView] = useRecoilState(
entityCountInCurrentViewState,
);
useEffect(() => {
setAvailableFilters(opportunitiesBoardOptions.filters);
setAvailableSorts(opportunitiesBoardOptions.sorts);
@ -158,6 +163,7 @@ export const HooksCompanyBoardEffect = () => {
setActionBarEntries();
setContextMenuEntries();
updateCompanyBoard(pipeline, pipelineProgresses, companiesData.companies);
setEntityCountInCurrentView(companiesData.companies.length);
}
}, [
loading,
@ -169,6 +175,7 @@ export const HooksCompanyBoardEffect = () => {
setContextMenuEntries,
searchParams,
handleViewSelect,
setEntityCountInCurrentView,
]);
return <></>;