display wallet icon, m&n, account number - refactor

This commit is contained in:
Javier 2017-01-04 19:22:33 -03:00 committed by Matias Alejo Garcia
commit 6fc0ed2327
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
3 changed files with 24 additions and 31 deletions

View file

@ -11,8 +11,7 @@ angular.module('copayApp.services')
root.LIVENET_PATH = 0; root.LIVENET_PATH = 0;
root._err = function(data) { root._err = function(data) {
var msg = 'Hardware Wallet Error: ' + (data.error || data.message || 'unknown'); var msg = data.error || data.message || 'unknown';
$log.warn(msg);
return msg; return msg;
}; };

View file

@ -27,21 +27,18 @@ angular.module('copayApp.services')
root._messageAfterSession({ root._messageAfterSession({
command: "get_xpubkey", command: "get_xpubkey",
path: path path: path
}) });
}; };
root.getInfoForNewWallet = function(isMultisig, account, callback) { root.getInfoForNewWallet = function(isMultisig, account, callback) {
var opts = {};
root.getEntropySource(isMultisig, account, function(err, entropySource) { root.getEntropySource(isMultisig, account, function(err, entropySource) {
if (err) return callback(err); if (err) return callback(err);
opts.entropySource = entropySource;
root.getXPubKey(hwWallet.getAddressPath('ledger', isMultisig, account), function(data) { root.getXPubKey(hwWallet.getAddressPath('ledger', isMultisig, account), function(data) {
if (!data.success) { if (!data.success) return callback(data);
$log.warn(data.message);
return callback(data); var opts = {};
} opts.entropySource = entropySource;
opts.extendedPublicKey = data.xpubkey; opts.extendedPublicKey = data.xpubkey;
opts.externalSource = 'ledger'; opts.externalSource = 'ledger';
opts.account = account; opts.account = account;
@ -130,7 +127,7 @@ angular.module('copayApp.services')
root._should_poll_session = false; root._should_poll_session = false;
} else if (typeof root.callbacks[data.command] == "function") { } else if (typeof root.callbacks[data.command] == "function") {
root.callbacks[data.command](data); root.callbacks[data.command](data);
} } else {}
} else { } else {
root._should_poll_session = false; root._should_poll_session = false;
Object.keys(root.callbacks).forEach(function(key) { Object.keys(root.callbacks).forEach(function(key) {

View file

@ -1,15 +1,12 @@
<span ng-show="wallet.isShared" class="size-12"><span translate>{{wallet.m}}-of-{{wallet.n}}</span></span> <span ng-show="wallet.status.wallet.singleAddress" class="size-12"><span translate>Auditable</span></span>
<span ng-show="wallet.isSingleAddress" class="size-12"><span translate>Auditable</span></span>
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.network != 'livenet'" src="img/icon-testnet-white.svg"> <img style="height:0.6em; margin-right: 1px;" ng-show="wallet.network != 'livenet'" src="img/icon-testnet-white.svg">
<img style="height:0.6em; margin-right: 1px;" ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()" <img style="height:0.6em; margin-right: 1px;" ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()" src="img/icon-read-only-white.svg">
src="img/icon-read-only-white.svg">
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'trezor'" <img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'trezor'" src="img/icon-trezor-white.svg">
src="img/icon-trezor-white.svg"> <img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'ledger'" src="img/icon-ledger-white.svg">
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'ledger'" <span ng-show="wallet.credentials.n > 1" class="size-12"><span translate>{{wallet.m}}-of-{{wallet.n}}</span></span>
src="img/icon-ledger-white.svg"> <span class="size-12 dib" style="height:0.6em; margin-right: 1px;" ng-show="wallet.credentials.account">#{{wallet.credentials.account || 0}} </span>
<span class="size-12 dib" style="height:0.6em; margin-right: 1px;" ng-show="wallet.account">#{{wallet.account || 0}} </span>
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.isPrivKeyEncrypted()" src="img/icon-lock-white.svg"> <img style="height:0.6em; margin-right: 1px;" ng-show="wallet.isPrivKeyEncrypted()" src="img/icon-lock-white.svg">