2015-03-06 12:00:10 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
2015-08-08 09:30:50 -03:00
|
|
|
angular.module('copayApp.controllers').controller('wordsController',
|
2015-08-08 10:58:30 -03:00
|
|
|
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?');
|
2015-08-08 10:58:30 -03:00
|
|
|
var successMsg = gettext('Backup words deleted');
|
|
|
|
|
|
2015-08-08 10:10:44 -03:00
|
|
|
this.done = function() {
|
|
|
|
|
$rootScope.$emit('Local/BackupDone');
|
|
|
|
|
};
|
2015-08-08 10:58:30 -03:00
|
|
|
|
|
|
|
|
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(' ');
|
|
|
|
|
|
|
|
|
|
this.mnemonicHasPassphrase = fc.mnemonicHasPassphrase();
|
2015-03-06 12:00:10 -03:00
|
|
|
});
|