bug with harvest plans on the map, when you look at a plan that has tasks, and then look at one that doesn't it was retaining the tasks from the previous plan and not resetting it to an ampty array

This commit is contained in:
csawatzky 2026-02-09 16:51:39 -06:00
parent 6206a898d1
commit e9281b2812

View file

@ -187,7 +187,11 @@ export default function HarvestSettings(props: Props) {
const loadTasks = useCallback(() => {
if (planKey) {
taskAPI.getMultiTasks([planKey], as).then(resp => {
setPlanTasks(resp.data.tasks.map(t => Task.any(t)));
if(resp.data.tasks){
setPlanTasks(resp.data.tasks.map(t => Task.any(t)));
}else{
setPlanTasks([])
}
});
}
}, [taskAPI, planKey, as]);