From eef61bfd51418ac958e4c57ea14169f411ec556a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 18 Nov 2015 15:14:09 -0300 Subject: [PATCH] security preferences in wallet preferences --- public/views/preferences.html | 42 +++++++++++++++++++----- public/views/preferencesAdvanced.html | 10 +++++- public/views/preferencesDeleteWords.html | 42 +++++++++++++++++------- public/views/securityPreferences.html | 35 -------------------- src/js/controllers/preferences.js | 17 ++++++---- src/js/routes.js | 12 ------- 6 files changed, 84 insertions(+), 74 deletions(-) delete mode 100644 public/views/securityPreferences.html diff --git a/public/views/preferences.html b/public/views/preferences.html index 1b905d09e..a75e66212 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -9,8 +9,8 @@

-
+
diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 195914114..52bb3634f 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -7,6 +7,7 @@

+ +
diff --git a/public/views/preferencesDeleteWords.html b/public/views/preferencesDeleteWords.html index 0025f6808..796ec99bf 100644 --- a/public/views/preferencesDeleteWords.html +++ b/public/views/preferencesDeleteWords.html @@ -1,35 +1,53 @@
+ ng-init="titleSection='Delete Seed Words'; goBackToState = 'preferences'">

+
+ Wallet: {{index.walletName}} ({{index.alias}}) +
+

Warning!

+
+ {{preferences.error|translate}} +
+
-

- Once you have copied your wallet seed down, it is recommended to delete it from this device. -

-

- Need to do backup -

+ +

+ + Once you have copied your wallet seed down, it is recommended to delete it from this device. + +

+ +

+ + Need to do backup + +

+ +
-
+ + diff --git a/public/views/securityPreferences.html b/public/views/securityPreferences.html deleted file mode 100644 index 3ee9fce2e..000000000 --- a/public/views/securityPreferences.html +++ /dev/null @@ -1,35 +0,0 @@ -
-
- -
-

- -
-

- Spending Restrictions -

-
    -
  • - -
    Request Password
    -
  • -
  • - -
    Scan Fingerprint
    -
  • -
-
-

diff --git a/src/js/controllers/preferences.js b/src/js/controllers/preferences.js index 1701f16be..046d4e6da 100644 --- a/src/js/controllers/preferences.js +++ b/src/js/controllers/preferences.js @@ -2,7 +2,13 @@ angular.module('copayApp.controllers').controller('preferencesController', function($scope, $rootScope, $timeout, $log, configService, profileService) { - + + var fc = profileService.focusedClient; + $scope.deleted = false; + if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic) { + $scope.deleted = true; + } + this.init = function() { var config = configService.getSync(); var fc = profileService.focusedClient; @@ -37,8 +43,8 @@ angular.module('copayApp.controllers').controller('preferencesController', }); }); } else { - if (!val && fc.hasPrivKeyEncrypted()) { - profileService.unlockFC(function(err){ + if (!val && fc.hasPrivKeyEncrypted()) { + profileService.unlockFC(function(err) { if (err) { $scope.encrypt = true; return; @@ -70,14 +76,13 @@ angular.module('copayApp.controllers').controller('preferencesController', opts.touchIdFor[walletId] = newVal; $rootScope.$emit('Local/RequestTouchid', function(err) { - if (err) { + if (err) { $log.debug(err); $timeout(function() { $scope.touchidError = true; $scope.touchid = oldVal; }, 100); - } - else { + } else { configService.set(opts, function(err) { if (err) { $log.debug(err); diff --git a/src/js/routes.js b/src/js/routes.js index 0e2da59b8..b2baef96c 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -286,18 +286,6 @@ angular } }) - .state('securityPreferences', { - url: '/securityPreferences', - templateUrl: 'views/securityPreferences.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/securityPreferences.html' - }, - } - }) - .state('preferencesAdvanced', { url: '/preferencesAdvanced', templateUrl: 'views/preferencesAdvanced.html',