Wallet/src/js/controllers/backup.js

34 lines
1,013 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) {
2015-09-09 17:53:05 -03:00
var msg = gettext('Are you sure you want to delete the backup words?');
var successMsg = gettext('Backup words deleted');
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();
});
}
});
};
2015-09-03 16:49:46 -03:00
var fc = profileService.focusedClient;
var words = fc.getMnemonic();
if (words)
this.mnemonicWords = words.split(/[\u3000\s]+/);
2015-09-03 16:49:46 -03:00
this.mnemonicHasPassphrase = fc.mnemonicHasPassphrase();
2015-09-18 10:22:10 -03:00
this.useIdeograms = words.indexOf("\u3000") >= 0;
2015-03-06 12:00:10 -03:00
});