Wallet/src/js/controllers/preferencesDeleteWords.js

22 lines
780 B
JavaScript
Raw Normal View History

'use strict';
2016-06-14 15:11:56 -03:00
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', function($scope, confirmDialog, lodash, notification, profileService, go, gettext) {
2016-06-04 16:19:19 -03:00
var fc = profileService.focusedClient;
var msg = gettext('Are you sure you want to delete the recovery phrase?');
var successMsg = gettext('Recovery phrase deleted');
2016-06-04 16:19:19 -03:00
if (lodash.isEmpty(fc.credentials.mnemonic) && lodash.isEmpty(fc.credentials.mnemonicEncrypted))
$scope.deleted = true;
2015-12-04 13:30:51 -03:00
$scope.delete = function() {
2016-06-04 16:19:19 -03:00
confirmDialog.show(msg, function(ok) {
if (ok) {
fc.clearMnemonic();
2016-06-06 18:26:45 -03:00
profileService.updateCredentials(fc.export(), function() {
2016-06-04 16:19:19 -03:00
notification.success(successMsg);
go.walletHome();
});
2016-06-04 16:19:19 -03:00
}
});
};
});