diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 6110b0d62..710bf3545 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -67,6 +67,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun setPendingTxps(status.pendingTxps); $scope.status = status; } + refreshAmountSection(); $timeout(function() { $scope.$apply(); }); @@ -264,7 +265,12 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return; } prevPos = pos; - var amountHeight = 210 - pos; + refreshAmountSection(pos); + }; + + function refreshAmountSection(scrollPos) { + scrollPos = scrollPos || 0; + var amountHeight = 210 - scrollPos; if (amountHeight < 80) { amountHeight = 80; } @@ -334,7 +340,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }); $scope.updateAll(); - getScrollPosition(); + refreshAmountSection(); listeners = [ $rootScope.$on('bwsEvent', function(e, walletId) { diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index fc3c0261d..9ca86ae54 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -160,16 +160,17 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim // Address with Balance cache.balanceByAddress = balance.byAddress; + // Total wallet balance is same regardless of 'spend unconfirmed funds' setting. + cache.totalBalanceSat = balance.totalAmount; + // Spend unconfirmed funds if (config.spendUnconfirmed) { - cache.totalBalanceSat = balance.totalAmount; cache.lockedBalanceSat = balance.lockedAmount; cache.availableBalanceSat = balance.availableAmount; cache.totalBytesToSendMax = balance.totalBytesToSendMax; cache.pendingAmount = 0; cache.spendableAmount = balance.totalAmount - balance.lockedAmount; } else { - cache.totalBalanceSat = balance.totalConfirmedAmount; cache.lockedBalanceSat = balance.lockedConfirmedAmount; cache.availableBalanceSat = balance.availableConfirmedAmount; cache.totalBytesToSendMax = balance.totalBytesToSendConfirmedMax;