Wallet/src/js/controllers/backup.js

34 lines
955 B
JavaScript
Raw Normal View History

2015-03-06 12:00:10 -03:00
'use strict';
angular.module('copayApp.controllers').controller('wordsController',
function($rootScope, $scope, $timeout, profileService, go, gettext, confirmDialog, notification) {
var msg = gettext('Are you to delete the backup words?');
var successMsg = gettext('Backup words deleted');
this.getMnemonic = function() {
2015-03-06 12:00:10 -03:00
var fc = profileService.focusedClient;
var words = fc.getMnemonic();
if (!words) return;
return words.split(' ');
2015-03-06 12:00:10 -03:00
};
2015-08-08 10:10:44 -03:00
this.done = function() {
$rootScope.$emit('Local/BackupDone');
};
this.delete = function() {
var fc = profileService.focusedClient;
confirmDialog.show(msg,function(ok){
if (ok) {
fc.clearMnemonic();
profileService.updateCredentialsFC(function() {
notification.success(successMsg);
go.walletHome();
});
}
});
};
this.mywords = this.getMnemonic();
2015-03-06 12:00:10 -03:00
});