diff --git a/app-template/bitpay/appConfig.json b/app-template/bitpay/appConfig.json index 2bdcef286..1c9decb34 100644 --- a/app-template/bitpay/appConfig.json +++ b/app-template/bitpay/appConfig.json @@ -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, diff --git a/app-template/setup-win.iss b/app-template/setup-win.iss index b0faaa163..f9dbac910 100755 --- a/app-template/setup-win.iss +++ b/app-template/setup-win.iss @@ -19,7 +19,7 @@ AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} -OutputBaseFilename=*USERVISIBLENAME*-win +OutputBaseFilename=*USERVISIBLENAME* OutputDir=./ Compression=lzma SolidCompression=yes diff --git a/src/js/controllers/buyAmazon.js b/src/js/controllers/buyAmazon.js index b77fd93d5..ca1ddba94 100644 --- a/src/js/controllers/buyAmazon.js +++ b/src/js/controllers/buyAmazon.js @@ -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); }; diff --git a/src/js/services/homeIntegrations.js b/src/js/services/homeIntegrations.js deleted file mode 100644 index d99588a80..000000000 --- a/src/js/services/homeIntegrations.js +++ /dev/null @@ -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; - - }); diff --git a/src/js/services/openURL.js b/src/js/services/openURL.js index ff01dc78c..7c1af7417 100644 --- a/src/js/services/openURL.js +++ b/src/js/services/openURL.js @@ -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 + '://')) }); } }); diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index fbcb99e50..57ae94c0d 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -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); });