fix android import bug

This commit is contained in:
Gabriel Bazán 2015-11-11 10:37:07 -03:00
parent 934a42f2bd
commit 3ce8806286
1 changed files with 7 additions and 3 deletions

View File

@ -339,9 +339,13 @@ angular.module('copayApp.services')
root.setMetaData = function(walletClient, addressBook, historyCache, cb) { root.setMetaData = function(walletClient, addressBook, historyCache, cb) {
storageService.getAddressbook(walletClient.credentials.network, function(err, localAddressBook) { storageService.getAddressbook(walletClient.credentials.network, function(err, localAddressBook) {
localAddressBook = JSON.parse(localAddressBook); var localAddressBook1 = {};
if (!localAddressBook) localAddressBook = {}; try {
addressBook = lodash.merge(addressBook, localAddressBook); localAddressBook1 = JSON.parse(localAddressBook);
} catch (ex) {
$log.warn(ex);
}
var mergeAddressBook = lodash.merge(addressBook, localAddressBook1);
storageService.setAddressbook(walletClient.credentials.network, JSON.stringify(addressBook), function(err) { storageService.setAddressbook(walletClient.credentials.network, JSON.stringify(addressBook), function(err) {
if (err) return cb(err); if (err) return cb(err);
storageService.setTxHistory(JSON.stringify(historyCache), walletClient.credentials.walletId, function(err) { storageService.setTxHistory(JSON.stringify(historyCache), walletClient.credentials.walletId, function(err) {