Fix buying if operation is not completed inmediatly (#4110)
This commit is contained in:
parent
d248f2dcd2
commit
5886b22f07
2 changed files with 5 additions and 5 deletions
|
|
@ -151,10 +151,10 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController',
|
|||
self.error = {errors: [{ message: 'Could not create address' }]};
|
||||
return;
|
||||
}
|
||||
coinbaseService.savePendingTransaction(updatedTx.data, {toAddr: addr}, function(err) {
|
||||
updatedTx.data['toAddr'] = addr;
|
||||
coinbaseService.savePendingTransaction(updatedTx.data, {}, function(err) {
|
||||
self.loading = null;
|
||||
if (err) $log.debug(err);
|
||||
updatedTx.data['toAddr'] = addr;
|
||||
if (updatedTx.data.status == 'completed') {
|
||||
self.sendToCopay(token, account, updatedTx.data);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1390,8 +1390,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
}
|
||||
});
|
||||
} else if (tx.data.type == 'buy' && tx.data.status == 'pending' && tx.data.buy) {
|
||||
self.buyPending(tx.data);
|
||||
} else if (tx.data.type == 'buy' && tx.data.status == 'completed' && tx.data.buy) {
|
||||
self.sendToCopay(dataFromStorage);
|
||||
} else {
|
||||
coinbaseService.savePendingTransaction(dataFromStorage, {}, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
|
|
@ -1435,7 +1435,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
self.buyPending = function(tx) {
|
||||
self.sendToCopay = function(tx) {
|
||||
if (!tx) return;
|
||||
var data = {
|
||||
to: tx.toAddr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue