From b50407400913e893af98c0fab2eec9456672b5bf Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 16 Apr 2014 19:05:04 -0300 Subject: [PATCH] actually create wallet and redirect --- js/controllers/setup.js | 17 +++++++++++++---- ...t.walletfactory.js => test.Walletfactory.js} | 0 2 files changed, 13 insertions(+), 4 deletions(-) rename test/{test.walletfactory.js => test.Walletfactory.js} (100%) diff --git a/js/controllers/setup.js b/js/controllers/setup.js index 30828843e..e084218a3 100644 --- a/js/controllers/setup.js +++ b/js/controllers/setup.js @@ -1,11 +1,10 @@ 'use strict'; angular.module('copay.setup').controller('SetupController', - function($scope, $rootScope, $location, Network) { + function($scope, $rootScope, $location, walletFactory) { $scope.loading = false; - $scope.selectedWalletId = false; $scope.totalCopayers = config.wallet.totalCopayers; $scope.TCValues = []; for (var n = 1; n <= config.limits.totalCopayers; n++) @@ -27,8 +26,18 @@ angular.module('copay.setup').controller('SetupController', }) $scope.create = function(totalCopayers, requiredCopayers) { - alert(totalCopayers); - alert(requiredCopayers); + $scope.loading = true; + var opts = { + requiredCopayers: requiredCopayers, + totalCopayers: totalCopayers + }; + var w = walletFactory.create(); + w.on('open', function(){ + $location.path('peer'); + $rootScope.wallet = w; + $rootScope.$digest(); + }); + w.netStart(); }; }); diff --git a/test/test.walletfactory.js b/test/test.Walletfactory.js similarity index 100% rename from test/test.walletfactory.js rename to test/test.Walletfactory.js