Skip to content

Commit

Permalink
LF-4558 Replace the hook to check animals
Browse files Browse the repository at this point in the history
  • Loading branch information
SayakaOno committed Dec 6, 2024
1 parent 144469e commit 09af097
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { defaultTaskTypesSelector, userCreatedTaskTypesSelector } from '../../ta
import { showedSpotlightSelector } from '../../showedSpotlightSlice';
import { setSpotlightToShown } from '../../Map/saga';
import { currentAndPlannedManagementPlansSelector } from '../../managementPlanSlice';
import useAnimalInventoryItemCount from '../../../hooks/useAnimalInventoryItemCount';
import useAnimalsExist from '../../Animals/Inventory/useAnimalsExist';

function TaskTypeSelection({ history, match, location }) {
const userFarm = useSelector(userFarmSelector);
Expand All @@ -20,7 +20,7 @@ function TaskTypeSelection({ history, match, location }) {
const persistedPaths = [continuePath, customTaskPath];
const { planting_task } = useSelector(showedSpotlightSelector);
const isAdmin = useSelector(isAdminSelector);
const hasAnimals = !!useAnimalInventoryItemCount();
const { animalsExistOnFarm } = useAnimalsExist();

useEffect(() => {
dispatch(getTaskTypes());
Expand Down Expand Up @@ -60,7 +60,7 @@ function TaskTypeSelection({ history, match, location }) {
shouldShowPlantTaskSpotLight={!planting_task}
updatePlantTaskSpotlight={updatePlantTaskSpotlight}
hasCurrentManagementPlans={hasCurrentManagementPlans}
hasAnimals={hasAnimals}
hasAnimals={animalsExistOnFarm}
/>
</HookFormPersistProvider>
</>
Expand Down

0 comments on commit 09af097

Please sign in to comment.