mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
coa flush causes dispatcherror
This commit is contained in:
parent
b8c58aa900
commit
eaed301155
@ -14,27 +14,27 @@ class CoaActions {
|
||||
}
|
||||
|
||||
fetchOrCreate(id, bitcoinId) {
|
||||
return Q.Promise((resolve, reject) => {
|
||||
//return Q.Promise((resolve, reject) => {
|
||||
CoaFetcher.fetchOne(id)
|
||||
.then((res) => {
|
||||
if (res.coa) {
|
||||
this.actions.updateCoa(res.coa);
|
||||
resolve(res.coa);
|
||||
//resolve(res.coa);
|
||||
}
|
||||
else {
|
||||
this.actions.create(bitcoinId);
|
||||
this.actions.create(bitcoinId).defer();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.logGlobal(err);
|
||||
this.actions.updateCoa(null);
|
||||
reject(err);
|
||||
//reject(err);
|
||||
});
|
||||
});
|
||||
//});
|
||||
}
|
||||
|
||||
create(bitcoinId) {
|
||||
return Q.Promise((resolve, reject) => {
|
||||
//return Q.Promise((resolve, reject) => {
|
||||
CoaFetcher.create(bitcoinId)
|
||||
.then((res) => {
|
||||
this.actions.updateCoa(res.coa);
|
||||
@ -42,9 +42,9 @@ class CoaActions {
|
||||
.catch((err) => {
|
||||
console.logGlobal(err);
|
||||
this.actions.updateCoa(null);
|
||||
reject(err);
|
||||
//reject(err);
|
||||
});
|
||||
});
|
||||
//});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,6 +256,7 @@ let CoaDetails = React.createClass({
|
||||
componentDidMount() {
|
||||
let { edition } = this.props;
|
||||
CoaStore.listen(this.onChange);
|
||||
CoaActions.updateCoa({});
|
||||
if(edition.coa) {
|
||||
CoaActions.fetchOrCreate(edition.coa, edition.bitcoin_id);
|
||||
}
|
||||
@ -300,7 +301,7 @@ let CoaDetails = React.createClass({
|
||||
}
|
||||
return (
|
||||
<div className="text-center">
|
||||
<AscribeSpinner color='dark-blue' size='lg'/>
|
||||
<AscribeSpinner color='dark-blue' size='md'/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user