Fix kanban view picker total count (#10898)
Fixes https://github.com/twentyhq/twenty/issues/9790 Before https://github.com/user-attachments/assets/332ec338-ce87-4d4d-ac47-a4e76dceb5b0 After https://github.com/user-attachments/assets/93a03842-386a-4e75-a709-85a91bbc7679 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -7,11 +7,10 @@ import {
|
||||
useIcons,
|
||||
} from 'twenty-ui';
|
||||
|
||||
import { recordIndexEntityCountComponentSelector } from '@/object-record/record-index/states/selectors/recordIndexEntityCountComponentSelector';
|
||||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
||||
import { StyledDropdownButtonContainer } from '@/ui/layout/dropdown/components/StyledDropdownButtonContainer';
|
||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { useGetRecordIndexTotalCount } from '@/views/hooks/internal/useGetRecordIndexTotalCount';
|
||||
import { useGetCurrentViewOnly } from '@/views/hooks/useGetCurrentViewOnly';
|
||||
import { ViewsHotkeyScope } from '@/views/types/ViewsHotkeyScope';
|
||||
import { ViewPickerContentCreateMode } from '@/views/view-picker/components/ViewPickerContentCreateMode';
|
||||
@ -55,9 +54,7 @@ export const ViewPickerDropdown = () => {
|
||||
|
||||
const { updateViewFromCurrentState } = useUpdateViewFromCurrentState();
|
||||
|
||||
const entityCount = useRecoilComponentValueV2(
|
||||
recordIndexEntityCountComponentSelector,
|
||||
);
|
||||
const { totalCount } = useGetRecordIndexTotalCount();
|
||||
|
||||
const { isDropdownOpen: isViewsListDropdownOpen } = useDropdown(
|
||||
VIEW_PICKER_DROPDOWN_ID,
|
||||
@ -92,7 +89,7 @@ export const ViewPickerDropdown = () => {
|
||||
)}
|
||||
<StyledViewName>{currentView?.name ?? 'All'}</StyledViewName>
|
||||
<StyledDropdownLabelAdornments>
|
||||
{isDefined(entityCount) && <>· {entityCount} </>}
|
||||
{isDefined(totalCount) && <>· {totalCount} </>}
|
||||
<IconChevronDown size={theme.icon.size.sm} />
|
||||
</StyledDropdownLabelAdornments>
|
||||
</StyledDropdownButtonContainer>
|
||||
|
||||
Reference in New Issue
Block a user