refreshing wallet clears balance cache
This commit is contained in:
parent
046546e8d3
commit
2beda0c354
2 changed files with 5 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
||||||
if (w.isReady()) {
|
if (w.isReady()) {
|
||||||
w.sendWalletReady();
|
w.sendWalletReady();
|
||||||
if ($rootScope.addrInfos.length > 0) {
|
if ($rootScope.addrInfos.length > 0) {
|
||||||
|
controllerUtils.clearBalanceCache(w);
|
||||||
controllerUtils.updateBalance(w, function() {
|
controllerUtils.updateBalance(w, function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,10 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
var _balanceCache = {};
|
var _balanceCache = {};
|
||||||
|
root.clearBalanceCache = function(w) {
|
||||||
|
delete _balanceCache[w.getId()];
|
||||||
|
};
|
||||||
|
|
||||||
root.updateBalance = function(w, cb) {
|
root.updateBalance = function(w, cb) {
|
||||||
var updateScope = function(w, data, cb2) {
|
var updateScope = function(w, data, cb2) {
|
||||||
var satToUnit = 1 / w.settings.unitToSatoshi;
|
var satToUnit = 1 / w.settings.unitToSatoshi;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue