mirror of https://github.com/BTCPrivate/copay.git
fix key derivation cache in IOS
This commit is contained in:
parent
a0c64ea88d
commit
005c7a2664
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue