From 458615a49f5d2fe27bb173a2869ba51a7f6c5730 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 17:29:57 -0300 Subject: [PATCH] Fix paperWallet variables. Hide for testnet --- public/views/paperWallet.html | 2 +- public/views/preferencesAdvanced.html | 2 +- src/js/controllers/paperWallet.js | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 9f45ea91e..3975efcad 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -52,7 +52,7 @@

Funds founds

- {{paperWallet.balance}} BTC + {{paperWallet.balance}}
diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index a7d41335e..95fe861d3 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -17,7 +17,7 @@ Scan addresses for funds -
  • +
  • Sweep paper wallet
  • diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index d58664bf8..e7aacf700 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,5 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $http, $timeout, profileService, go, addressService, bitcore) { + function($scope, $http, $timeout, configService, profileService, go, addressService, bitcore) { self = this; var fc = profileService.focusedClient; var rawTx; @@ -9,12 +9,13 @@ angular.module('copayApp.controllers').controller('paperWalletController', } self.createTx = function(privateKey, passphrase) { - if (privateKey.charAt(0) != 6) { + if (privateKey.charAt(0) != '6') { var isValidKey = self.checkPrivateKey(privateKey); if (!isValidKey) return; } + var config = configService.getSync().wallet.settings; self.error = null; self.scanning = true; $timeout(function() { @@ -24,7 +25,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', if (err) self.error = err.toString(); else { - self.balance = (utxos / 1e8).toFixed(8); + self.balance = profileService.formatAmount(utxos) + ' ' + config.unitName; rawTx = rawtx; }