Skip to content

Commit

Permalink
SOF-7298: fix constrainedMagnetization data
Browse files Browse the repository at this point in the history
  • Loading branch information
pranabdas committed Apr 21, 2024
1 parent 222fe60 commit 0f2a86a
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -19,6 +19,7 @@ export class NonCollinearMagnetizationContextProvider extends mix(JSONSchemaForm
this.isExistingChargeDensity = lodash.get(this.data, "isExistingChargeDensity", false);
this.isArbitrarySpinDirection = lodash.get(this.data, "isArbitrarySpinDirection", false);
this.isFixedMagnetization = lodash.get(this.data, "isFixedMagnetization", false);
this.constrainedMagnetization = lodash.get(this.data, "constrainedMagnetization", {});
}

get uniqueElementsWithLabels() {
Expand Down Expand Up @@ -111,7 +112,7 @@ export class NonCollinearMagnetizationContextProvider extends mix(JSONSchemaForm
isFixedMagnetization: {
"ui:readonly":
!this.isConstrainedMagnetization &&
!(this.data.constrainedMagnetization.constrainType === "total"),
!(this.constrainedMagnetization?.constrainType === "total"),
},
fixedMagnetization: {
x: this.defaultFieldStyles,
Expand All @@ -120,7 +121,7 @@ export class NonCollinearMagnetizationContextProvider extends mix(JSONSchemaForm
"ui:readonly":
this.isFixedMagnetization &&
!this.isConstrainedMagnetization &&
!(this.data.constrainedMagnetization.constrainType === "total"),
!(this.constrainedMagnetization?.constrainType === "total"),
},
};
}
Expand Down

0 comments on commit 0f2a86a

Please sign in to comment.