Merge branch 'ref/design' of github.com:bitpay/bitpay-wallet into scanHandling
This commit is contained in:
commit
01d5e1d2eb
36 changed files with 332 additions and 145 deletions
|
|
@ -23,10 +23,10 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
|||
reconnectDelay: 5000,
|
||||
idleDurationMin: 4,
|
||||
settings: {
|
||||
unitName: 'bits',
|
||||
unitName: 'BTC',
|
||||
unitToSatoshi: 100,
|
||||
unitDecimals: 2,
|
||||
unitCode: 'bit',
|
||||
unitCode: 'btc',
|
||||
alternativeName: 'US Dollar',
|
||||
alternativeIsoCode: 'USD',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -601,6 +601,16 @@ angular.module('copayApp.services')
|
|||
$log.debug('Importing Wallet:', opts);
|
||||
|
||||
try {
|
||||
var c = JSON.parse(str);
|
||||
|
||||
if (c.xPrivKey && c.xPrivKeyEncrypted) {
|
||||
$log.warn('Found both encrypted and decrypted key. Deleting the encrypted version');
|
||||
delete c.xPrivKeyEncrypted;
|
||||
delete c.mnemonicEncrypted;
|
||||
}
|
||||
|
||||
str = JSON.stringify(c);
|
||||
|
||||
walletClient.import(str, {
|
||||
compressed: opts.compressed,
|
||||
password: opts.password
|
||||
|
|
@ -609,14 +619,6 @@ angular.module('copayApp.services')
|
|||
return cb(gettext('Could not import. Check input file and spending password'));
|
||||
}
|
||||
|
||||
str = JSON.parse(str);
|
||||
|
||||
if (str.xPrivKey && str.xPrivKeyEncrypted) {
|
||||
$log.warn('Found both encrypted and decrypted key. Deleting the encrypted version');
|
||||
delete str.xPrivKeyEncrypted;
|
||||
delete str.mnemonicEncrypted;
|
||||
}
|
||||
|
||||
var addressBook = str.addressBook || {};
|
||||
|
||||
addAndBindWalletClient(walletClient, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue