diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index 1aaf06e07..fb8b840d1 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('disclaimerController', - function($scope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go) { + function($scope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go, storageService) { var self = this; self.tries = 0; self.creatingProfile = true; @@ -38,7 +38,7 @@ angular.module('copayApp.controllers').controller('disclaimerController', $ionicSideMenuDelegate.canDragContent(false); self.lang = uxLanguage.currentLanguage; - profileService.getProfile(function(err, profile) { + storageService.getProfile(function(err, profile) { if (!profile) { create(opts); } else { diff --git a/src/js/services/platformInfo.js b/src/js/services/platformInfo.js index 2d9a3ae94..f634e8f0f 100644 --- a/src/js/services/platformInfo.js +++ b/src/js/services/platformInfo.js @@ -5,10 +5,13 @@ angular.module('copayApp.services').factory('platformInfo', function($window) { var ua = navigator ? navigator.userAgent : null; if (!ua) { - console.log('Could not determine navigator. Using a random string'); - ua = Math.floor(Math.random() * 100000); + console.log('Could not determine navigator. Using fixed string'); + ua = 'dummy user-agent'; } + // Fixes IOS WebKit UA + ua = ua.replace(/\(\d+\)$/, ''); + var isNodeWebkit = function() { var isNode = (typeof process !== "undefined" && typeof require !== "undefined"); if (isNode) { diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index fab54e654..e5058389e 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -127,7 +127,6 @@ angular.module('copayApp.services') if (!credentials.walletId) throw 'bindWallet should receive credentials JSON'; - $log.debug('Bind wallet:' + credentials.walletId); // Create the client var getBWSURL = function(walletId) { @@ -137,6 +136,7 @@ angular.module('copayApp.services') }; var skipKeyValidation = root.profile.isChecked(platformInfo.ua, credentials.walletId); + $log.info('Binding wallet:' + credentials.walletId + ' Validating?:' + !skipKeyValidation); var client = bwcService.getClient(JSON.stringify(credentials), { bwsurl: getBWSURL(credentials.walletId), skipKeyValidation: skipKeyValidation,