From 52a5a22967c1e7691c9f6dd591b69910bd8f2130 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 23 Jun 2022 10:53:39 +0100 Subject: [PATCH] only copy keys from the chosen category by default --- app/src/frontend/building/data-container.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index d4ed9354..ce1db51b 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -82,8 +82,11 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine const newBuildingId = props.building == undefined ? undefined : props.building.building_id; const newBuildingRevisionId = props.building == undefined ? undefined : props.building.revision_id; const categoryKeys = {}; + for (let key in dataFields) { - categoryKeys[key] = true; + if (dataFields[key].category == props.cat){ + categoryKeys[key] = true; + } } if(newBuildingId !== state.currentBuildingId || newBuildingRevisionId > state.currentBuildingRevisionId) { return {