adding delete words option to security Preferences
This commit is contained in:
parent
95217cef02
commit
7b3e308e25
6 changed files with 150 additions and 35 deletions
23
src/js/controllers/preferencesDeleteWords.js
Normal file
23
src/js/controllers/preferencesDeleteWords.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController',
|
||||
function($scope, $rootScope, $filter, $timeout, $modal, $log, confirmDialog, storageService, notification, profileService, isCordova, go, gettext, gettextCatalog, animationService) {
|
||||
var self = this;
|
||||
var fc = profileService.focusedClient;
|
||||
var msg = gettext('Are you sure you want to delete the backup words?');
|
||||
var successMsg = gettext('Backup words deleted');
|
||||
|
||||
self.delete = function() {
|
||||
confirmDialog.show(msg,
|
||||
function(ok) {
|
||||
if (ok) {
|
||||
fc.clearMnemonic();
|
||||
profileService.updateCredentialsFC(function() {
|
||||
notification.success(successMsg);
|
||||
go.walletHome();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
12
src/js/controllers/securityPreferences.js
Normal file
12
src/js/controllers/securityPreferences.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('securityPreferencesController',
|
||||
function($scope, profileService) {
|
||||
var self = this;
|
||||
var fc = profileService.focusedClient;
|
||||
self.deleted = false;
|
||||
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic) {
|
||||
self.deleted = true;
|
||||
}
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue