mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Merge pull request #79 from ascribe/hotfix-contract-creation
Hotfix contract agreement creation failing on first time
This commit is contained in:
commit
95bce14220
@ -83,9 +83,9 @@ class ContractAgreementListActions {
|
||||
contractAgreementList in the store is already set to null;
|
||||
*/
|
||||
}
|
||||
}).then((publicContracAgreement) => {
|
||||
if (publicContracAgreement) {
|
||||
this.actions.updateContractAgreementList([publicContracAgreement]);
|
||||
}).then((publicContractAgreement) => {
|
||||
if (publicContractAgreement) {
|
||||
this.actions.updateContractAgreementList([publicContractAgreement]);
|
||||
}
|
||||
}).catch(console.logGlobal);
|
||||
}
|
||||
@ -93,7 +93,10 @@ class ContractAgreementListActions {
|
||||
createContractAgreement(issuer, contract){
|
||||
return Q.Promise((resolve, reject) => {
|
||||
OwnershipFetcher
|
||||
.createContractAgreement(issuer, contract).then(resolve)
|
||||
.createContractAgreement(issuer, contract)
|
||||
.then((res) => {
|
||||
resolve(res && res.contractagreement)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.logGlobal(err);
|
||||
reject(err);
|
||||
|
@ -41,6 +41,14 @@ let ConsignForm = React.createClass({
|
||||
};
|
||||
},
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.email !== nextProps.email) {
|
||||
this.setState({
|
||||
email: nextProps.email
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getFormData() {
|
||||
return this.props.id;
|
||||
},
|
||||
|
@ -61,6 +61,14 @@ let LoanForm = React.createClass({
|
||||
};
|
||||
},
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.email !== nextProps.email) {
|
||||
this.setState({
|
||||
email: nextProps.email
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onChange(state) {
|
||||
this.setState(state);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user