diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index 6a3d86eba..751b7c863 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -2,12 +2,14 @@ ng-if="agreed && index.hasProfile" class="topbar-container" ng-include="'views/includes/topbar.html'" - ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true"> + ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true" +> + -
+

Terms of Use diff --git a/public/views/splash.html b/public/views/splash.html index 5c343df9b..754e969b6 100644 --- a/public/views/splash.html +++ b/public/views/splash.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js new file mode 100644 index 000000000..1468a7025 --- /dev/null +++ b/src/js/controllers/disclaimer.js @@ -0,0 +1,28 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('disclaimerController', + function($scope, $timeout, storageService, applicationService, go, gettextCatalog, isCordova) { + storageService.getCopayDisclaimerFlag(function(err, val) { + $scope.agreed = val; + $timeout(function() { + $scope.$digest(); + }, 1); + }); + + $scope.agree = function() { + if (isCordova) { + window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true); + } + $scope.loading = true; + $timeout(function() { + storageService.setCopayDisclaimerFlag(function(err) { + $timeout(function() { + if (isCordova) { + window.plugins.spinnerDialog.hide(); + } + applicationService.restart(); + }, 1000); + }); + }, 100); + }; + }); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 8f1b6f806..3b9af9078 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -273,7 +273,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r return cb(null, opts.walletStatus); else { self.updateError = false; - return fc.getStatus(function(err, ret) { + return fc.getStatus({}, function(err, ret) { if (err) { self.updateError = bwsError.msg(err, gettext('Could not update Wallet')); } else { diff --git a/src/js/controllers/splash.js b/src/js/controllers/splash.js new file mode 100644 index 000000000..b957be3f9 --- /dev/null +++ b/src/js/controllers/splash.js @@ -0,0 +1,32 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('splashController', + function($scope, $timeout, $log, profileService, storageService, go) { + storageService.getCopayDisclaimerFlag(function(err, val) { + if (!val) go.path('disclaimer'); + + if (profileService.profile) { + go.walletHome(); + } + }); + + $scope.create = function(noWallet) { + $scope.creatingProfile = true; + + $timeout(function() { + profileService.create({ + noWallet: noWallet + }, function(err) { + if (err) { + $scope.creatingProfile = false; + $log.warn(err); + $scope.error = err; + $scope.$apply(); + $timeout(function() { + $scope.create(noWallet); + }, 3000); + } + }); + }, 100); + }; + }); diff --git a/src/js/routes.js b/src/js/routes.js index 97879ae17..2487cd4fe 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -81,35 +81,6 @@ angular views: { 'main': { templateUrl: 'views/splash.html', - controller: function($scope, $timeout, $log, profileService, storageService, go) { - storageService.getCopayDisclaimerFlag(function(err, val) { - if (!val) go.path('disclaimer'); - - if (profileService.profile) { - go.walletHome(); - } - }); - - $scope.create = function(noWallet) { - $scope.creatingProfile = true; - - $timeout(function() { - profileService.create({ - noWallet: noWallet - }, function(err) { - if (err) { - $scope.creatingProfile = false; - $log.warn(err); - $scope.error = err; - $scope.$apply(); - $timeout(function() { - $scope.create(noWallet); - }, 3000); - } - }); - }, 100); - }; - } } } }); @@ -131,31 +102,6 @@ angular views: { 'main': { templateUrl: 'views/disclaimer.html', - controller: function($scope, $timeout, storageService, applicationService, go, gettextCatalog, isCordova) { - storageService.getCopayDisclaimerFlag(function(err, val) { - $scope.agreed = val; - $timeout(function() { - $scope.$digest(); - }, 1); - }); - - $scope.agree = function() { - if (isCordova) { - window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true); - } - $scope.loading = true; - $timeout(function() { - storageService.setCopayDisclaimerFlag(function(err) { - $timeout(function() { - if (isCordova) { - window.plugins.spinnerDialog.hide(); - } - applicationService.restart(); - }, 1000); - }); - }, 100); - }; - } } } }) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 143c2724d..05e5fbd34 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -165,6 +165,13 @@ angular.module('copayApp.services') }); }; + root._seedWallet = function(walletClient) { + var config = configService.getSync().wallet.settings; +console.log('[profileService.js.169:config:]',config); //TODO +asdd; + walletClient.seedFromRandomWithMnemonic('livenet',null, mnemonicLang); + }; + root._createNewProfile = function(opts, cb) { if (opts.noWallet) { @@ -172,10 +179,7 @@ angular.module('copayApp.services') } var walletClient = bwcService.getClient(); - // TODO LANG... - // TODO... - $log.warn("TODO LANG!") - walletClient.seedFromRandomWithMnemonic('livenet'); + this._seedWallet(walletClient); walletClient.createWallet('Personal Wallet', 'me', 1, 1, { network: 'livenet'