diff --git a/js/controllers/head.js b/js/controllers/head.js index 6593ee32d..3a665d01e 100644 --- a/js/controllers/head.js +++ b/js/controllers/head.js @@ -16,6 +16,20 @@ angular.module('copayApp.controllers').controller('HeadController', function($sc controllerUtils.logout(); }; + $scope.refresh = function() { + var w = $rootScope.wallet; + if (!w) return; + + if (w.isReady()) { + w.sendWalletReady(); + if ($rootScope.addrInfos.length > 0) { + controllerUtils.clearBalanceCache(w); + controllerUtils.updateBalance(w, function() { + $rootScope.$digest(); + }); + } + } + }; // Ensures a graceful disconnect window.onbeforeunload = function() { diff --git a/views/includes/head.html b/views/includes/head.html index 18cf9b318..e74957ef7 100644 --- a/views/includes/head.html +++ b/views/includes/head.html @@ -19,4 +19,9 @@
+