commit
952a834fff
1 changed files with 18 additions and 21 deletions
|
|
@ -1,26 +1,23 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController',
|
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', function(confirmDialog, lodash, notification, profileService, go, gettext) {
|
||||||
function(confirmDialog, notification, profileService, go, gettext) {
|
var self = this;
|
||||||
var self = this;
|
var fc = profileService.focusedClient;
|
||||||
var fc = profileService.focusedClient;
|
var msg = gettext('Are you sure you want to delete the recovery phrase?');
|
||||||
var msg = gettext('Are you sure you want to delete the backup words?');
|
var successMsg = gettext('Recovery phrase deleted');
|
||||||
var successMsg = gettext('Backup words deleted');
|
|
||||||
|
|
||||||
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic)
|
if (lodash.isEmpty(fc.credentials.mnemonic) && lodash.isEmpty(fc.credentials.mnemonicEncrypted))
|
||||||
self.deleted = true;
|
self.deleted = true;
|
||||||
|
|
||||||
self.delete = function() {
|
self.delete = function() {
|
||||||
confirmDialog.show(msg,
|
confirmDialog.show(msg, function(ok) {
|
||||||
function(ok) {
|
if (ok) {
|
||||||
if (ok) {
|
fc.clearMnemonic();
|
||||||
fc.clearMnemonic();
|
profileService.updateCredentialsFC(function() {
|
||||||
profileService.updateCredentialsFC(function() {
|
notification.success(successMsg);
|
||||||
notification.success(successMsg);
|
go.walletHome();
|
||||||
go.walletHome();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
});
|
||||||
});
|
};
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue