Merge pull request #298 from cmgustavo/feature/01-signin-related
Feature/01 signin related
This commit is contained in:
commit
fc48d68ec9
5 changed files with 145 additions and 49 deletions
|
|
@ -32,7 +32,12 @@ angular.module('copay.setup').controller('SetupController',
|
|||
updateRCSelect(tc);
|
||||
});
|
||||
|
||||
$scope.create = function() {
|
||||
$scope.create = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loading = true;
|
||||
|
||||
var passphrase = Passphrase.getBase64($scope.walletPassword);
|
||||
|
|
|
|||
|
|
@ -7,25 +7,35 @@ angular.module('copay.signin').controller('SigninController',
|
|||
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
||||
$scope.openPassword = '';
|
||||
|
||||
$scope.create = function() {
|
||||
$scope.loading = true;
|
||||
$scope.create = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
$rootScope.walletName = $scope.walletName;
|
||||
$rootScope.walletPassword = $scope.createPassword;
|
||||
$rootScope.walletName = form.walletName.$modelValue;
|
||||
$rootScope.walletPassword = form.createPassword.$modelValue;
|
||||
$location.path('setup');
|
||||
};
|
||||
|
||||
$scope.open = function() {
|
||||
if ($scope.openPassword != '') {
|
||||
$scope.loading = true;
|
||||
|
||||
var passphrase = Passphrase.getBase64($scope.openPassword);
|
||||
var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase});
|
||||
controllerUtils.startNetwork(w);
|
||||
$scope.open = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
$scope.loading = true;
|
||||
var password = form.openPassword.$modelValue;
|
||||
|
||||
var passphrase = Passphrase.getBase64(password);
|
||||
var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase});
|
||||
controllerUtils.startNetwork(w);
|
||||
};
|
||||
|
||||
$scope.join = function() {
|
||||
$scope.join = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
$scope.loading = true;
|
||||
|
||||
walletFactory.network.on('badSecret', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue