add fieldName block var

This commit is contained in:
Ed Chalstrey 2022-06-24 14:19:37 +01:00
parent 593be69514
commit 3320614176

View File

@ -81,10 +81,12 @@ const withCopyEdit: (wc: React.ComponentType<CategoryViewProps>) => DataContaine
static getDerivedStateFromProps(props, state): DataContainerState {
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 && props.building[key] != null){
for (let key in dataFields) {
let fieldName = props.building == undefined ? undefined : props.building[key];
if (dataFields[key].category == props.cat && fieldName != null){
categoryKeys[key] = true;
}
}