Removed console errors

This commit is contained in:
Matias Pando 2014-11-03 14:34:38 -03:00
parent 16c3d66f33
commit 0c741814f3
3 changed files with 6 additions and 22 deletions

View File

@ -19,12 +19,6 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
var _importBackup = function(str) {
var password = $scope.password;
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, {
pluginManager: pluginManager,
@ -34,11 +28,9 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
passphraseConfig: config.passphraseConfig,
}, function(err, iden) {
if (err && !iden) {
console.log('Error:' + err)
controllerUtils.onErrorDigest(
$scope, (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error');
} else {
console.log('Success.....Profile imported successfully');
notification.info('Success', 'Profile imported successfully');
$location.path('/');
}

View File

@ -287,17 +287,6 @@ Identity.prototype.close = function(cb) {
* @return {Wallet}
*/
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;
// TODO set iter and salt using config.js
var key = crypto.kdf(password);
@ -355,7 +344,11 @@ Identity.prototype.closeWallet = function(wallet, cb) {
Identity.importFromEncryptedFullJson = function(str, password, opts, cb) {
var crypto = opts.cryptoUtil || cryptoUtil;
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) {
@ -364,7 +357,7 @@ Identity.importFromFullJson = function(str, password, opts, cb) {
try {
json = JSON.parse(str);
} 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))

View File

@ -112,7 +112,6 @@ angular
$location.path('unsupported');
} else {
if (!$rootScope.iden && next.logged) {
console.log('not logged... redirecting')
$idle.unwatch();
$location.path('/');
}