Split signin.html in home, join and open files. Signin process with responsive support
This commit is contained in:
parent
f4d4f819de
commit
9875e9d643
21 changed files with 329 additions and 288 deletions
37
js/controllers/join.js
Normal file
37
js/controllers/join.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('JoinController',
|
||||
function($scope, $rootScope, walletFactory, controllerUtils, Passphrase, notification) {
|
||||
$scope.loading = false;
|
||||
|
||||
$scope.join = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
notification.error('Error', 'Please enter the required fields');
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loading = true;
|
||||
walletFactory.network.on('badSecret', function() {});
|
||||
|
||||
Passphrase.getBase64Async($scope.joinPassword, function(passphrase) {
|
||||
walletFactory.joinCreateSession($scope.connectionId, $scope.nickname, passphrase, function(err, w) {
|
||||
$scope.loading = false;
|
||||
if (err || !w) {
|
||||
if (err === 'joinError')
|
||||
notification.error('Can\'t find peer.');
|
||||
else if (err === 'walletFull')
|
||||
notification.error('The wallet is full');
|
||||
else if (err === 'badNetwork')
|
||||
notification.error('Network Error', 'The wallet your are trying to join uses a different Bitcoin Network. Check your settings.');
|
||||
else if (err === 'badSecret')
|
||||
notification.error('Bad secret', 'The secret string you entered is invalid');
|
||||
else
|
||||
notification.error('Unknown error');
|
||||
controllerUtils.onErrorDigest();
|
||||
} else {
|
||||
controllerUtils.startNetwork(w, $scope);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue