Fix Conflicts:
js/controllers/signin.js
This commit is contained in:
commit
88a7fca8d8
12 changed files with 295 additions and 115 deletions
|
|
@ -7,30 +7,40 @@ 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});
|
||||
if (!w) {
|
||||
$scope.loading = false;
|
||||
$rootScope.flashMessage = { message: 'Bad password or connection error', type: 'error'};
|
||||
return;
|
||||
}
|
||||
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});
|
||||
if (!w) {
|
||||
$scope.loading = false;
|
||||
$rootScope.flashMessage = { message: 'Bad password or connection error', type: 'error'};
|
||||
return;
|
||||
}
|
||||
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