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:
parent
6206a898d1
commit
e9281b2812
1 changed files with 5 additions and 1 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue