diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 6fda1692..2c914b78 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -240,7 +240,7 @@ export function useRoofAllocationSetting(id) { const onDeleteRoofMaterial = (idx) => { const isSelected = currentRoofList[idx].selected - const newRoofList = [...currentRoofList].filter((_, index) => index !== idx) + const newRoofList = JSON.parse(JSON.stringify(currentRoofList)).filter((_, index) => index !== idx) if (isSelected) { newRoofList[0].selected = true }