added password support to UI/Controllers
This commit is contained in:
parent
cd4db8a097
commit
9d27a0b85d
4 changed files with 24 additions and 13 deletions
|
|
@ -1,11 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copay.password').controller('PasswordController',
|
||||
function($scope, $rootScope) {
|
||||
function($scope, $rootScope, Passphrase, walletFactory, controllerUtils) {
|
||||
$scope.title = 'Password';
|
||||
$scope.loading = false;
|
||||
|
||||
$scope.getPassphrase = function() {
|
||||
console.log('######### Password', $scope.password);
|
||||
};
|
||||
$scope.loading = true;
|
||||
var passphrase = Passphrase.getBase64($scope.password);
|
||||
|
||||
var w = walletFactory.open($rootScope.openedWalletId, { passphrase: passphrase});
|
||||
controllerUtils.startNetwork(w);
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copay.setup').controller('SetupController',
|
||||
function($scope, $rootScope, $location, walletFactory, controllerUtils) {
|
||||
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
|
||||
|
||||
$scope.loading = false;
|
||||
|
||||
|
|
@ -33,13 +33,15 @@ angular.module('copay.setup').controller('SetupController',
|
|||
|
||||
$scope.create = function(totalCopayers, requiredCopayers, walletName, myNickname) {
|
||||
$scope.loading = true;
|
||||
var passphrase = Passphrase.getBase64($scope.walletPassword);
|
||||
|
||||
var opts = {
|
||||
requiredCopayers: requiredCopayers,
|
||||
totalCopayers: totalCopayers,
|
||||
name: walletName,
|
||||
nickname: myNickname,
|
||||
passphrase: passphrase,
|
||||
};
|
||||
console.log('[setup.js.31:opts:]',opts); //TODO
|
||||
var w = walletFactory.create(opts);
|
||||
controllerUtils.startNetwork(w);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,10 +12,11 @@ angular.module('copay.signin').controller('SigninController',
|
|||
$location.path('setup');
|
||||
};
|
||||
|
||||
$scope.open = function(walletId, opts) {
|
||||
$scope.open = function(walletId) {
|
||||
$scope.loading = true;
|
||||
var w = walletFactory.open(walletId, opts);
|
||||
controllerUtils.startNetwork(w);
|
||||
$rootScope.openedWalletId = walletId;
|
||||
|
||||
$location.path('password');
|
||||
};
|
||||
|
||||
$scope.join = function(secret, nickname ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue