1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 00:28:00 +02:00

probably fix dispatch.dispatch error + showing wrong piece data bug

This commit is contained in:
Tim Daubenschütz 2015-09-21 10:57:10 +02:00
parent 9d67d046d0
commit 0819724a10
4 changed files with 12 additions and 3 deletions

View File

@ -15,8 +15,9 @@ class ContractAgreementListActions {
}
fetchContractAgreementList(issuer, accepted, pending) {
this.actions.updateContractAgreementList(null);
return Q.Promise((resolve, reject) => {
this.actions.updateContractAgreementList(null);
OwnershipFetcher.fetchContractAgreementList(issuer, accepted, pending)
.then((contractAgreementList) => {
if (contractAgreementList.count > 0) {

View File

@ -20,6 +20,8 @@ let InputTextAreaToggable = React.createClass({
},
componentDidUpdate(prevProps, prevState) {
// if the components state value was changed during an update, we want to refresh it
// in this component as well as in the parent Property
if(this.state.value !== prevState.value) {
this.handleChange({
target: {
@ -28,6 +30,8 @@ let InputTextAreaToggable = React.createClass({
});
}
// Otherwise, if state wasn't defined beforehand and defaultValue is defined from the outside
// we set it as the component's state and update Property by calling handleChange
if(!this.state.value && this.props.defaultValue) {
this.handleChange({
target: {

View File

@ -19,8 +19,8 @@ import { getLangText } from '../../utils/lang_utils';
let AccountSettings = React.createClass({
propTypes: {
currentUser: React.PropTypes.object.required,
loadUser: React.PropTypes.func.required
currentUser: React.PropTypes.object.isRequired,
loadUser: React.PropTypes.func.isRequired
},
handleSuccess(){

View File

@ -57,6 +57,10 @@ let IkonotvRegisterPiece = React.createClass({
PieceStore.listen(this.onChange);
UserActions.fetchCurrentUser();
// Before we load the new piece, we reset the piece store to delete old data that we do
// not want to display to the user.
PieceActions.updatePiece({});
let queryParams = this.getQuery();
// Since every step of this register process is atomic,