fix refreshUntilItChanges
This commit is contained in:
parent
1fca607300
commit
b32b29259a
3 changed files with 22 additions and 11 deletions
|
|
@ -185,12 +185,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
self.setOngoingProcess('updatingStatus', true);
|
self.setOngoingProcess('updatingStatus', true);
|
||||||
$log.debug('Updating Status:', fc);
|
$log.debug('Updating Status:', fc, tries);
|
||||||
get(function(err, walletStatus) {
|
get(function(err, walletStatus) {
|
||||||
if (!err && untilItChanges && initBalance == walletStatus.balance.totalAmount && tries < 10) {
|
if (!err && untilItChanges && initBalance == walletStatus.balance.totalAmount && tries < 7) {
|
||||||
return $timeout(function() {
|
return $timeout(function() {
|
||||||
return self.updateAll(null, true, initBalance, ++tries);
|
return self.updateAll(null, true, initBalance, ++tries);
|
||||||
}, 1000);
|
}, 1400 * tries);
|
||||||
}
|
}
|
||||||
self.setOngoingProcess('updatingStatus', false);
|
self.setOngoingProcess('updatingStatus', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -709,7 +709,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
lodash.each(['NewOutgoingTx', 'NewTxProposal', 'TxProposalFinallyRejected', 'TxProposalRemoved',
|
$rootScope.$on('NewOutgoingTx', function() {
|
||||||
|
self.updateAll(null, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
lodash.each(['NewTxProposal', 'TxProposalFinallyRejected', 'TxProposalRemoved',
|
||||||
'Local/NewTxProposal', 'Local/TxProposalAction', 'ScanFinished'
|
'Local/NewTxProposal', 'Local/TxProposalAction', 'ScanFinished'
|
||||||
], function(eventName) {
|
], function(eventName) {
|
||||||
$rootScope.$on(eventName, function(event, untilItChanges) {
|
$rootScope.$on(eventName, function(event, untilItChanges) {
|
||||||
|
|
|
||||||
|
|
@ -223,8 +223,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
if (memo)
|
if (memo)
|
||||||
$log.info(memo);
|
$log.info(memo);
|
||||||
|
|
||||||
console.log('[walletHome.js.223]'); //TODO
|
txpsb.refreshUntilItChanges = true;
|
||||||
$modalInstance.close(txpsb, true);
|
$modalInstance.close(txpsb);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -293,7 +293,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
if (memo)
|
if (memo)
|
||||||
$log.info(memo);
|
$log.info(memo);
|
||||||
$modalInstance.close(txpb, true);
|
|
||||||
|
txpb.refreshUntilItChanges = true;
|
||||||
|
$modalInstance.close(txpb);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
@ -320,7 +322,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
m.addClass('slideOutRight');
|
m.addClass('slideOutRight');
|
||||||
});
|
});
|
||||||
|
|
||||||
modalInstance.result.then(function(txp, refreshUntilItChanges) {
|
modalInstance.result.then(function(txp) {
|
||||||
|
var refreshUntilItChanges = txp.refreshUntilItChanges;
|
||||||
|
console.log('[walletHome.js.323:refreshUntilItChanges:]', refreshUntilItChanges); //TODO
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
if (txp) {
|
if (txp) {
|
||||||
txStatus.notify(txp, function() {
|
txStatus.notify(txp, function() {
|
||||||
|
|
@ -421,7 +425,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
};
|
};
|
||||||
|
|
||||||
this.resetError = function() {
|
this.resetError = function() {
|
||||||
this.error = this.success = null;
|
this.error = this.success = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.bindTouchDown = function(tries) {
|
this.bindTouchDown = function(tries) {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
root.storeLast = function(notificationData, walletId) {
|
root.storeLast = function(notificationData, walletId) {
|
||||||
|
|
||||||
|
if (notificationData.type == 'NewAddress')
|
||||||
|
return;
|
||||||
|
|
||||||
lastNotificationOnWallet[walletId] = {
|
lastNotificationOnWallet[walletId] = {
|
||||||
creatorId: notificationData.creatorId,
|
creatorId: notificationData.creatorId,
|
||||||
type: notificationData.type,
|
type: notificationData.type,
|
||||||
|
|
@ -38,7 +42,6 @@ angular.module('copayApp.services')
|
||||||
&& notificationData.type === 'TxProposalFinallyRejected')
|
&& notificationData.type === 'TxProposalFinallyRejected')
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -73,7 +76,7 @@ angular.module('copayApp.services')
|
||||||
name, {color: color} );
|
name, {color: color} );
|
||||||
break;
|
break;
|
||||||
case 'NewOutgoingTx':
|
case 'NewOutgoingTx':
|
||||||
notification.sent(gettext('Payment Proposal Sent'),
|
notification.sent(gettext('Payment Sent'),
|
||||||
name, {color: color} );
|
name, {color: color} );
|
||||||
break;
|
break;
|
||||||
case 'NewIncomingTx':
|
case 'NewIncomingTx':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue