only copy keys from the chosen category by default

This commit is contained in:
Ed Chalstrey 2022-06-23 10:53:39 +01:00
parent bfe519d7fe
commit 52a5a22967

View File

@ -82,9 +82,12 @@ const withCopyEdit: (wc: React.ComponentType<CategoryViewProps>) => 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) {
if (dataFields[key].category == props.cat){
categoryKeys[key] = true;
}
}
if(newBuildingId !== state.currentBuildingId || newBuildingRevisionId > state.currentBuildingRevisionId) {
return {
error: undefined,