Wallet/src/js/controllers/password.js
Kirvx aee30ec151
Change Seed to Recovery Phrase, and more. (#4201)
* Seed -> Recovery Phrase ; Passphrase -> Password ; Password -> Spending Password

* More Spending Password
2016-05-13 13:00:54 -03:00

43 lines
1.1 KiB
JavaScript

'use strict';
angular.module('copayApp.controllers').controller('passwordController',
function($rootScope, $scope, $timeout, profileService, notification, go, gettext) {
var pass1;
this.isVerification = false;
document.getElementById("passwordInput").focus();
this.close = function(cb) {
return cb('No spending password given');
};
this.set = function(isSetup, cb) {
this.loading = true;
this.error = false;
var self = this;
$timeout(function() {
if (isSetup && !self.isVerification) {
self.loading = false;
document.getElementById("passwordInput").focus();
self.isVerification = true;
pass1 = $scope.password;
$scope.password = null;
return;
}
if (isSetup && pass1 != $scope.password) {
self.loading = false;
self.error = gettext('Spending Passwords do not match');
self.isVerification = false;
$scope.password = null;
pass1 = null;
return;
}
return cb(null, $scope.password);
}, 100);
};
});