1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +01:00

Revert "coa flush causes dispatcherror"

This reverts commit eaed301155.
This commit is contained in:
Tim Daubenschütz 2015-12-08 11:49:03 +01:00
parent eaed301155
commit bf6b78c058
2 changed files with 9 additions and 10 deletions

View File

@ -14,27 +14,27 @@ class CoaActions {
} }
fetchOrCreate(id, bitcoinId) { fetchOrCreate(id, bitcoinId) {
//return Q.Promise((resolve, reject) => { return Q.Promise((resolve, reject) => {
CoaFetcher.fetchOne(id) CoaFetcher.fetchOne(id)
.then((res) => { .then((res) => {
if (res.coa) { if (res.coa) {
this.actions.updateCoa(res.coa); this.actions.updateCoa(res.coa);
//resolve(res.coa); resolve(res.coa);
} }
else { else {
this.actions.create(bitcoinId).defer(); this.actions.create(bitcoinId);
} }
}) })
.catch((err) => { .catch((err) => {
console.logGlobal(err); console.logGlobal(err);
this.actions.updateCoa(null); this.actions.updateCoa(null);
//reject(err); reject(err);
}); });
//}); });
} }
create(bitcoinId) { create(bitcoinId) {
//return Q.Promise((resolve, reject) => { return Q.Promise((resolve, reject) => {
CoaFetcher.create(bitcoinId) CoaFetcher.create(bitcoinId)
.then((res) => { .then((res) => {
this.actions.updateCoa(res.coa); this.actions.updateCoa(res.coa);
@ -42,9 +42,9 @@ class CoaActions {
.catch((err) => { .catch((err) => {
console.logGlobal(err); console.logGlobal(err);
this.actions.updateCoa(null); this.actions.updateCoa(null);
//reject(err); reject(err);
}); });
//}); });
} }
} }

View File

@ -256,7 +256,6 @@ let CoaDetails = React.createClass({
componentDidMount() { componentDidMount() {
let { edition } = this.props; let { edition } = this.props;
CoaStore.listen(this.onChange); CoaStore.listen(this.onChange);
CoaActions.updateCoa({});
if(edition.coa) { if(edition.coa) {
CoaActions.fetchOrCreate(edition.coa, edition.bitcoin_id); CoaActions.fetchOrCreate(edition.coa, edition.bitcoin_id);
} }
@ -301,7 +300,7 @@ let CoaDetails = React.createClass({
} }
return ( return (
<div className="text-center"> <div className="text-center">
<AscribeSpinner color='dark-blue' size='md'/> <AscribeSpinner color='dark-blue' size='lg'/>
</div> </div>
); );
} }