integrate new name and header. Signin/signout flow
This commit is contained in:
parent
28247a87c6
commit
4cd48b7bb2
12 changed files with 130 additions and 74 deletions
|
|
@ -2,23 +2,36 @@
|
|||
|
||||
angular.module('copay.signin').controller('SigninController',
|
||||
function($scope, $rootScope, $location, Network) {
|
||||
$scope.loading = false;
|
||||
$rootScope.peerId = null;
|
||||
$scope.peerReady = false;
|
||||
|
||||
// Init peer
|
||||
Network.init(function(pid) {
|
||||
$rootScope.peerId = pid;
|
||||
$rootScope.$digest();
|
||||
|
||||
$scope.peerReady = true;
|
||||
$scope.$digest();
|
||||
});
|
||||
$rootScope.copayers = [];
|
||||
|
||||
$scope.create = function() {
|
||||
$scope.loading = true;
|
||||
Network.init(function(pid) {
|
||||
$rootScope.copayers.push(pid);
|
||||
$location.path('peer');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.join = function(cid) {
|
||||
console.log('------- join --------');
|
||||
console.log(cid);
|
||||
$scope.loading = true;
|
||||
$rootScope.connectionId = cid;
|
||||
Network.init(function(pid) {
|
||||
|
||||
console.log('------- join --------');
|
||||
console.log(pid);
|
||||
|
||||
$rootScope.copayers.push(pid);
|
||||
|
||||
Network.connect(cid, function(copayer) {
|
||||
console.log('----- join master --------');
|
||||
console.log(copayer);
|
||||
$rootScope.copayers.push(copayer);
|
||||
|
||||
$location.path('peer');
|
||||
});
|
||||
});
|
||||
|
||||
var pid = cid || $rootScope.peerId;
|
||||
$location.path('join/' + pid);
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue