mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
fix PR comments
This commit is contained in:
parent
9085a2bafe
commit
71f94768d9
@ -37,11 +37,11 @@ class ContractAgreementListActions {
|
||||
|
||||
fetchAvailableContractAgreementList(issuer){
|
||||
return Q.Promise((resolve, reject) => {
|
||||
this.actions.fetchContractAgreementList(issuer, 'True', null)
|
||||
this.actions.fetchContractAgreementList(issuer, true, null)
|
||||
.then((contractAgreementListAccepted) => {
|
||||
if (!contractAgreementListAccepted) {
|
||||
// fetch pending agreements if no accepted ones
|
||||
return this.actions.fetchContractAgreementList(issuer, null, 'True');
|
||||
return this.actions.fetchContractAgreementList(issuer, null, true);
|
||||
}
|
||||
else {
|
||||
resolve(contractAgreementListAccepted);
|
||||
|
@ -21,7 +21,7 @@ let AclProxy = React.createClass({
|
||||
},
|
||||
|
||||
getChildren() {
|
||||
if (this.props.children.length && this.props.children.length > 1){
|
||||
if (React.Children.count(this.props.children) > 1){
|
||||
/*
|
||||
This might ruin styles for header items in the navbar etc
|
||||
*/
|
||||
|
@ -57,6 +57,15 @@ let LoanForm = React.createClass({
|
||||
this.getContractAgreementsOrCreatePublic(this.props.email);
|
||||
},
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
// however, it can also be that at the time the component is mounting,
|
||||
// the email is not defined (because it's asynchronously fetched from the server).
|
||||
// Then we need to update it as soon as it is included into LoanForm's props.
|
||||
if(nextProps && nextProps.email) {
|
||||
this.getContractAgreementsOrCreatePublic(nextProps.email);
|
||||
}
|
||||
},
|
||||
|
||||
componentWillUnmount() {
|
||||
ContractAgreementListStore.unlisten(this.onChange);
|
||||
},
|
||||
@ -70,7 +79,7 @@ let LoanForm = React.createClass({
|
||||
ContractAgreementListActions.fetchAvailableContractAgreementList(email).then(
|
||||
(contractAgreementList) => {
|
||||
if (!contractAgreementList) {
|
||||
ContractAgreementListActions.createContractAgreementFromPublicContract.defer(email);
|
||||
ContractAgreementListActions.createContractAgreementFromPublicContract(email);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user