Removed console errors
This commit is contained in:
parent
16c3d66f33
commit
0c741814f3
3 changed files with 6 additions and 22 deletions
|
|
@ -19,12 +19,6 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
|
||||||
var _importBackup = function(str) {
|
var _importBackup = function(str) {
|
||||||
var password = $scope.password;
|
var password = $scope.password;
|
||||||
updateStatus('Importing profile - Setting things up...');
|
updateStatus('Importing profile - Setting things up...');
|
||||||
// var skipFields = [];
|
|
||||||
// if ($scope.skipPublicKeyRing)
|
|
||||||
// skipFields.push('publicKeyRing');
|
|
||||||
//
|
|
||||||
// if ($scope.skipTxProposals)
|
|
||||||
// skipFields.push('txProposals');
|
|
||||||
|
|
||||||
copay.Identity.importFromEncryptedFullJson(str, password, {
|
copay.Identity.importFromEncryptedFullJson(str, password, {
|
||||||
pluginManager: pluginManager,
|
pluginManager: pluginManager,
|
||||||
|
|
@ -34,11 +28,9 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
|
||||||
passphraseConfig: config.passphraseConfig,
|
passphraseConfig: config.passphraseConfig,
|
||||||
}, function(err, iden) {
|
}, function(err, iden) {
|
||||||
if (err && !iden) {
|
if (err && !iden) {
|
||||||
console.log('Error:' + err)
|
|
||||||
controllerUtils.onErrorDigest(
|
controllerUtils.onErrorDigest(
|
||||||
$scope, (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error');
|
$scope, (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error');
|
||||||
} else {
|
} else {
|
||||||
console.log('Success.....Profile imported successfully');
|
|
||||||
notification.info('Success', 'Profile imported successfully');
|
notification.info('Success', 'Profile imported successfully');
|
||||||
$location.path('/');
|
$location.path('/');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -287,17 +287,6 @@ Identity.prototype.close = function(cb) {
|
||||||
* @return {Wallet}
|
* @return {Wallet}
|
||||||
*/
|
*/
|
||||||
Identity.prototype.importEncryptedWallet = function(cypherText, password, opts, cb) {
|
Identity.prototype.importEncryptedWallet = function(cypherText, password, opts, cb) {
|
||||||
console.log('importEncryptedWallet------');
|
|
||||||
|
|
||||||
console.log('opts');
|
|
||||||
console.log(opts);
|
|
||||||
|
|
||||||
console.log('password');
|
|
||||||
console.log(password);
|
|
||||||
|
|
||||||
console.log('cypherText');
|
|
||||||
console.log(cypherText);
|
|
||||||
|
|
||||||
var crypto = opts.cryptoUtil || cryptoUtil;
|
var crypto = opts.cryptoUtil || cryptoUtil;
|
||||||
// TODO set iter and salt using config.js
|
// TODO set iter and salt using config.js
|
||||||
var key = crypto.kdf(password);
|
var key = crypto.kdf(password);
|
||||||
|
|
@ -355,7 +344,11 @@ Identity.prototype.closeWallet = function(wallet, cb) {
|
||||||
Identity.importFromEncryptedFullJson = function(str, password, opts, cb) {
|
Identity.importFromEncryptedFullJson = function(str, password, opts, cb) {
|
||||||
var crypto = opts.cryptoUtil || cryptoUtil;
|
var crypto = opts.cryptoUtil || cryptoUtil;
|
||||||
var key = crypto.kdf(password);
|
var key = crypto.kdf(password);
|
||||||
return Identity.importFromFullJson(crypto.decrypt(key, str), password, opts, cb);
|
var str = crypto.decrypt(key, str);
|
||||||
|
if (!str) {
|
||||||
|
return cb('BADSTR');
|
||||||
|
}
|
||||||
|
return Identity.importFromFullJson(str, password, opts, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
Identity.importFromFullJson = function(str, password, opts, cb) {
|
Identity.importFromFullJson = function(str, password, opts, cb) {
|
||||||
|
|
@ -364,7 +357,7 @@ Identity.importFromFullJson = function(str, password, opts, cb) {
|
||||||
try {
|
try {
|
||||||
json = JSON.parse(str);
|
json = JSON.parse(str);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return cb('Unable to retrieve json from string', str);
|
return cb('BADSTR: Unable to retrieve json from string', str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!_.isNumber(json.iterations))
|
// if (!_.isNumber(json.iterations))
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,6 @@ angular
|
||||||
$location.path('unsupported');
|
$location.path('unsupported');
|
||||||
} else {
|
} else {
|
||||||
if (!$rootScope.iden && next.logged) {
|
if (!$rootScope.iden && next.logged) {
|
||||||
console.log('not logged... redirecting')
|
|
||||||
$idle.unwatch();
|
$idle.unwatch();
|
||||||
$location.path('/');
|
$location.path('/');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue