Wallet/src/js/controllers/preferencesDeleteWords.js

26 lines
813 B
JavaScript
Raw Normal View History

'use strict';
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController',
2015-11-19 15:15:36 -03:00
function(confirmDialog, notification, profileService, go, gettext) {
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');
2015-12-04 13:30:51 -03:00
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic)
self.deleted = true;
self.delete = function() {
confirmDialog.show(msg,
function(ok) {
if (ok) {
fc.clearMnemonic();
profileService.updateCredentialsFC(function() {
notification.success(successMsg);
go.walletHome();
});
}
});
};
});