1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

fix PR comments

This commit is contained in:
diminator 2015-09-15 13:22:52 +02:00
parent 9085a2bafe
commit 71f94768d9
3 changed files with 13 additions and 4 deletions

View File

@ -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);

View File

@ -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
*/

View File

@ -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);
}
}
);