Merge branch 'master' into feat/bitpay-accounts

This commit is contained in:
Andy Phillipson 2017-02-09 13:13:20 -05:00
commit 7a2d386f34
6 changed files with 19 additions and 36 deletions

View file

@ -21,8 +21,8 @@
"windowsAppId": "2d1002d7-ee34-4f60-bd29-0c871ba0c195",
"pushSenderId": "1036948132229",
"description": "Secure Bitcoin Wallet",
"version": "1.3.5",
"androidVersion": "135000",
"version": "1.3.6",
"androidVersion": "136000",
"_extraCSS": null,
"_enabledExtensions": {
"coinbase": true,

View file

@ -19,7 +19,7 @@ AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=*USERVISIBLENAME*-win
OutputBaseFilename=*USERVISIBLENAME*
OutputDir=./
Compression=lzma
SolidCompression=yes

View file

@ -22,7 +22,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController', functio
var showError = function(msg, err) {
$scope.sendStatus = '';
$log.error(err);
err = err && err.errors ? err.errors[0].message : err;
err = err && err.errors ? err.errors[0].message : (err || '');
popupService.showAlert(msg, err);
};

View file

@ -1,23 +0,0 @@
'use strict';
angular.module('copayApp.services').factory('', function(configService, $log) {
var root = {};
var services = [];
root.register = function(serviceInfo) {
$log.info('Adding homeIntegration entry:' + serviceInfo.name);
services.push(serviceInfo);
};
root.unregister = function(serviceName) {
services = lodash.filter(services, function(x) {
return x.name != serviceName
});
};
root.get = function() {
return services;
};
return root;
});

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').factory('openURLService', function($rootScope, $ionicHistory, $document, $log, $state, platformInfo, lodash, profileService, incomingData) {
angular.module('copayApp.services').factory('openURLService', function($rootScope, $ionicHistory, $document, $log, $state, platformInfo, lodash, profileService, incomingData, appConfigService) {
var root = {};
var handleOpenURL = function(args) {
@ -61,10 +61,10 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop
handleOpenURL({
url: pathData.substring(pathData.indexOf('bitcoin:'))
});
} else if (pathData.indexOf('copay:') != -1) {
$log.debug('Copay URL found');
} else if (pathData.indexOf(appConfigService.name + '://') != -1) {
$log.debug(appConfigService.name + ' URL found');
handleOpenURL({
url: pathData.substring(pathData.indexOf('copay:'))
url: pathData.substring(pathData.indexOf(appConfigService.name + '://'))
});
}
});

View file

@ -425,9 +425,9 @@ angular.module('copayApp.services')
// }
root.removeBitpayDebitCard = function(network, cardEid, cb) {
root.getBitpayAccounts(network, function(err, allAccounts){
root.getBitpayAccounts(network, function(err, allAccounts) {
lodash.each(allAccounts, function(account){
lodash.each(allAccounts, function(account) {
account.cards = lodash.reject(account.cards, {
'eid': cardEid
});
@ -458,10 +458,16 @@ angular.module('copayApp.services')
storage.get('bitpayAccounts-v2-' + network, function(err, allAccountsStr) {
if (err) return cb(err);
if (!allAccountsStr)
return cb(null, {});
var allAccounts = {};
try {
allAccounts = JSON.parse(allAccountsStr);
} catch (e) {};
} catch (e) {
$log.error('Bad storage value for bitpayAccount-v2' + allAccountsStr)
return cb(null, {});
};
var anyMigration;
@ -485,10 +491,10 @@ angular.module('copayApp.services')
});
if (anyMigration) {
storage.set('bitpayAccounts-v2-' + network, allAccounts, function(){
storage.set('bitpayAccounts-v2-' + network, allAccounts, function() {
return cb(err, allAccounts);
});
} else
} else
return cb(err, allAccounts);
});