diff --git a/src/js/services/hwWallet.js b/src/js/services/hwWallet.js index 55d3ccc79..1c9314164 100644 --- a/src/js/services/hwWallet.js +++ b/src/js/services/hwWallet.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.services') - .factory('hwWallet', function($log, bwcService) { + .factory('hwWallet', function($log, bwcService) { var root = {}; // Ledger magic number to get xPub without user confirmation @@ -11,8 +11,7 @@ angular.module('copayApp.services') root.LIVENET_PATH = 0; root._err = function(data) { - var msg = 'Hardware Wallet Error: ' + (data.error || data.message || 'unknown'); - $log.warn(msg); + var msg = data.error || data.message || 'unknown'; return msg; }; @@ -21,13 +20,13 @@ angular.module('copayApp.services') if (!isMultisig) return root.UNISIG_ROOTPATH; // Compat - if (device == 'ledger' && account ==0) return root.UNISIG_ROOTPATH; + if (device == 'ledger' && account == 0) return root.UNISIG_ROOTPATH; return root.MULTISIG_ROOTPATH; }; root.getAddressPath = function(device, isMultisig, account) { - return root.getRootPath(device,isMultisig,account) + "'/" + root.LIVENET_PATH + "'/" + account + "'"; + return root.getRootPath(device, isMultisig, account) + "'/" + root.LIVENET_PATH + "'/" + account + "'"; } root.getEntropyPath = function(device, isMultisig, account) { @@ -35,9 +34,9 @@ angular.module('copayApp.services') // Old ledger wallet compat if (device == 'ledger' && account == 0) - return root.ENTROPY_INDEX_PATH + "0'"; + return root.ENTROPY_INDEX_PATH + "0'"; - return root.ENTROPY_INDEX_PATH + root.getRootPath(device,isMultisig,account) + "'/" + account + "'"; + return root.ENTROPY_INDEX_PATH + root.getRootPath(device, isMultisig, account) + "'/" + account + "'"; }; root.pubKeyToEntropySource = function(xPubKey) { diff --git a/src/js/services/ledger.js b/src/js/services/ledger.js index 98d892ccb..a58aa2906 100644 --- a/src/js/services/ledger.js +++ b/src/js/services/ledger.js @@ -17,7 +17,7 @@ angular.module('copayApp.services') if (!data.success) return callback(hwWallet._err(data)); - return callback(null, hwWallet.pubKeyToEntropySource(data.xpubkey)); + return callback(null, hwWallet.pubKeyToEntropySource(data.xpubkey)); }); }; @@ -27,21 +27,18 @@ angular.module('copayApp.services') root._messageAfterSession({ command: "get_xpubkey", path: path - }) + }); }; - root.getInfoForNewWallet = function(isMultisig, account, callback) { - var opts = {}; root.getEntropySource(isMultisig, account, function(err, entropySource) { if (err) return callback(err); - opts.entropySource = entropySource; root.getXPubKey(hwWallet.getAddressPath('ledger', isMultisig, account), function(data) { - if (!data.success) { - $log.warn(data.message); - return callback(data); - } + if (!data.success) return callback(data); + + var opts = {}; + opts.entropySource = entropySource; opts.extendedPublicKey = data.xpubkey; opts.externalSource = 'ledger'; opts.account = account; @@ -130,7 +127,7 @@ angular.module('copayApp.services') root._should_poll_session = false; } else if (typeof root.callbacks[data.command] == "function") { root.callbacks[data.command](data); - } + } else {} } else { root._should_poll_session = false; Object.keys(root.callbacks).forEach(function(key) { diff --git a/www/views/includes/walletInfo.html b/www/views/includes/walletInfo.html index c0f06a134..c9bb75245 100644 --- a/www/views/includes/walletInfo.html +++ b/www/views/includes/walletInfo.html @@ -1,19 +1,16 @@ -{{wallet.m}}-of-{{wallet.n}} -Auditable - - +Auditable + + - - -#{{wallet.account || 0}} + + +{{wallet.m}}-of-{{wallet.n}} +#{{wallet.credentials.account || 0}} - + - - + + - +