From 09af097929f8edf5784fd41238ea30de700297e7 Mon Sep 17 00:00:00 2001 From: Sayaka Ono Date: Thu, 5 Dec 2024 17:44:27 -0800 Subject: [PATCH] LF-4558 Replace the hook to check animals --- .../webapp/src/containers/Task/TaskTypeSelection/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webapp/src/containers/Task/TaskTypeSelection/index.jsx b/packages/webapp/src/containers/Task/TaskTypeSelection/index.jsx index 61cb55af70..ea1359bdf4 100644 --- a/packages/webapp/src/containers/Task/TaskTypeSelection/index.jsx +++ b/packages/webapp/src/containers/Task/TaskTypeSelection/index.jsx @@ -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); @@ -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()); @@ -60,7 +60,7 @@ function TaskTypeSelection({ history, match, location }) { shouldShowPlantTaskSpotLight={!planting_task} updatePlantTaskSpotlight={updatePlantTaskSpotlight} hasCurrentManagementPlans={hasCurrentManagementPlans} - hasAnimals={hasAnimals} + hasAnimals={animalsExistOnFarm} />