1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01: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) { fetchContractAgreementList(issuer, accepted, pending) {
return Q.Promise((resolve, reject) => {
this.actions.updateContractAgreementList(null); this.actions.updateContractAgreementList(null);
return Q.Promise((resolve, reject) => {
OwnershipFetcher.fetchContractAgreementList(issuer, accepted, pending) OwnershipFetcher.fetchContractAgreementList(issuer, accepted, pending)
.then((contractAgreementList) => { .then((contractAgreementList) => {
if (contractAgreementList.count > 0) { if (contractAgreementList.count > 0) {

View File

@ -20,6 +20,8 @@ let InputTextAreaToggable = React.createClass({
}, },
componentDidUpdate(prevProps, prevState) { 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) { if(this.state.value !== prevState.value) {
this.handleChange({ this.handleChange({
target: { 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) { if(!this.state.value && this.props.defaultValue) {
this.handleChange({ this.handleChange({
target: { target: {

View File

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

View File

@ -57,6 +57,10 @@ let IkonotvRegisterPiece = React.createClass({
PieceStore.listen(this.onChange); PieceStore.listen(this.onChange);
UserActions.fetchCurrentUser(); 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(); let queryParams = this.getQuery();
// Since every step of this register process is atomic, // Since every step of this register process is atomic,