From 29bbfa184c61a8ef77c540278016964fdd0e221f Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 11 Oct 2014 14:33:45 -0300 Subject: [PATCH] add warning for old wallets --- js/controllers/createProfile.js | 4 +--- js/controllers/home.js | 2 +- js/models/Profile.js | 4 ++-- js/models/Storage.js | 2 +- js/models/Wallet.js | 4 ++-- js/routes.js | 4 ---- views/createProfile.html | 2 +- views/home.html | 1 - views/open.html | 33 --------------------------------- 9 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 views/open.html diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index eec5e786d..20d9da77e 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -13,9 +13,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun }, function(anyWallet) { $scope.retreiving = false; $scope.anyProfile = anyProfile; -console.log('[createProfile.js.15:anyProfile:]',anyProfile); //TODO $scope.anyWallet = anyWallet; -console.log('[createProfile.js.17:anyWallet:]',anyWallet); //TODO }); }); @@ -32,7 +30,7 @@ console.log('[createProfile.js.17:anyWallet:]',anyWallet); //TODO network: config.network, networkName: config.networkName, walletDefaults: config.wallet, - passphrase: config.passphrase, + passphraseConfig: config.passphraseConfig, }, function(err, iden, firstWallet) { controllerUtils.bindProfile($scope, iden, firstWallet); }); diff --git a/js/controllers/home.js b/js/controllers/home.js index 3a3797027..0b606146e 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -24,7 +24,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc network: config.network, networkName: config.networkName, walletDefaults: config.wallet, - passphrase: config.passphrase, + passphraseConfig: config.passphraseConfig, }, function(err, iden, firstWallet) { if (err && !iden) { console.log('Error:' + err) diff --git a/js/models/Profile.js b/js/models/Profile.js index 8f74a3373..232bf6764 100644 --- a/js/models/Profile.js +++ b/js/models/Profile.js @@ -45,8 +45,8 @@ Profile.create = function(email, password, storage, cb) { Profile.any = function(storage, cb) { - storage.getFirst(Profile.key(''), function(err, val) { - return cb(val ? true : false); + storage.getFirst(Profile.key(''), function(err, v, k) { + return cb(k ? true : false); }); }; diff --git a/js/models/Storage.js b/js/models/Storage.js index 936bbdc05..3275a1ff7 100644 --- a/js/models/Storage.js +++ b/js/models/Storage.js @@ -163,7 +163,7 @@ Storage.prototype.getFirst = function(prefix, cb) { }); if (keys.length === 0) return cb(new Error('not found')); self._read(keys[0], function(v) { - if (_.isNull(v)) return cb(new Error('Could not decrypt data')); + if (_.isNull(v)) return cb(new Error('Could not decrypt data'), null, keys[0]); return cb(null, v, keys[0]); }) }); diff --git a/js/models/Wallet.js b/js/models/Wallet.js index 92a25ad3f..bc534aea4 100644 --- a/js/models/Wallet.js +++ b/js/models/Wallet.js @@ -174,8 +174,8 @@ Wallet.key = function(str) { Wallet.any = function(storage, cb) { - storage.getFirst(Wallet.key(''), function(err, val) { - return cb(val ? true : false); + storage.getFirst(Wallet.key(''), function(err, v, k) { + return cb(k ? true : false); }); }; diff --git a/js/routes.js b/js/routes.js index 2f4ce3f49..140626356 100644 --- a/js/routes.js +++ b/js/routes.js @@ -14,10 +14,6 @@ angular templateUrl: 'views/createProfile.html', validate: false }) - .when('/open', { - templateUrl: 'views/open.html', - validate: false - }) .when('/join', { templateUrl: 'views/join.html', validate: true diff --git a/views/createProfile.html b/views/createProfile.html index 4623f4bfd..3da07d81a 100644 --- a/views/createProfile.html +++ b/views/createProfile.html @@ -4,7 +4,7 @@
- Copay now needs a profile to access your wallets.
+ Copay now needs a profile to access wallets.
You can import current your wallets after creating your profile.
diff --git a/views/home.html b/views/home.html index 100b854f6..80400d903 100644 --- a/views/home.html +++ b/views/home.html @@ -1,6 +1,5 @@
-

( TODO: if user has wallets (wallet::) show message: Copay now needs a profile to ... , you can import your wallets after creating your profile )

Retreiving information from storage... diff --git a/views/open.html b/views/open.html deleted file mode 100644 index 2d3ef85a9..000000000 --- a/views/open.html +++ /dev/null @@ -1,33 +0,0 @@ -
-
- - Retreiving information from storage... -
-
- - Connecting... -
-
-
- Copay -
-
-
-
-

Open Wallet

-
- - -
- « Back - -
-
-
-
-
-
- -