Skip to content

Commit

Permalink
CM-323: fixed displaying params on contract level (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
sniedzielski authored Sep 27, 2023
1 parent c767d16 commit 6e2fc51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ContractForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ class ContractForm extends Component {
this.setState((state, props) => ({
contract: {
...state.contract,
policyHolder: props.policyHolders.find((v) => decodeId(v.id) === props.predefinedPolicyHolderId)
policyHolder: props.predefinedPolicyHolderId
? props.policyHolders.find((v) => decodeId(v.id) === props.predefinedPolicyHolderId)
: ( props.contract.policyHolder
? props.policyHolders.find((v) => decodeId(v.id) === decodeId(props.contract.policyHolder.id))
: null
)
}
}));
}
Expand Down

0 comments on commit 6e2fc51

Please sign in to comment.