Merge pull request #3670 from gabrielbazan7/fix/NoConnectionBug
fix no conecction bug in disclaimer
This commit is contained in:
commit
45953ec390
3 changed files with 20 additions and 6 deletions
|
|
@ -16,7 +16,7 @@
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="right-small" ng-show="showPreferences">
|
<section class="right-small" ng-show="showPreferences && !index.noFocusedWallet">
|
||||||
<a class="p10" ng-click="topbar.goPreferences()">
|
<a class="p10" ng-click="topbar.goPreferences()">
|
||||||
<i class="fi-widget size-24"></i>
|
<i class="fi-widget size-24"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,13 @@
|
||||||
angular.module('copayApp.controllers').controller('disclaimerController',
|
angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
function($scope, $timeout, $log, profileService, isCordova, storageService, applicationService, gettextCatalog, uxLanguage, go) {
|
function($scope, $timeout, $log, profileService, isCordova, storageService, applicationService, gettextCatalog, uxLanguage, go) {
|
||||||
self = this;
|
self = this;
|
||||||
|
self.tries = 0;
|
||||||
|
|
||||||
var create = function() {
|
var create = function(noWallet) {
|
||||||
$scope.creatingProfile = true;
|
$scope.creatingProfile = true;
|
||||||
profileService.create({}, function(err) {
|
profileService.create({
|
||||||
|
noWallet: noWallet
|
||||||
|
}, function(err) {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.warn(err);
|
$log.warn(err);
|
||||||
|
|
@ -14,7 +17,13 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$log.warn('Retrying to create profile......');
|
$log.warn('Retrying to create profile......');
|
||||||
create();
|
if (self.tries == 3) {
|
||||||
|
self.tries == 0;
|
||||||
|
create(true);
|
||||||
|
} else {
|
||||||
|
self.tries += 1;
|
||||||
|
create(false);
|
||||||
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
} else {
|
} else {
|
||||||
$scope.error = "";
|
$scope.error = "";
|
||||||
|
|
@ -26,7 +35,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
this.init = function() {
|
this.init = function() {
|
||||||
self.lang = uxLanguage.currentLanguage;
|
self.lang = uxLanguage.currentLanguage;
|
||||||
storageService.getProfile(function(err, profile) {
|
storageService.getProfile(function(err, profile) {
|
||||||
if (!profile) create();
|
if (!profile) create(false);
|
||||||
else $scope.creatingProfile = false;
|
else $scope.creatingProfile = false;
|
||||||
|
|
||||||
//compatible
|
//compatible
|
||||||
|
|
|
||||||
|
|
@ -1357,12 +1357,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$on('Local/NoWallets', function(event) {
|
$rootScope.$on('Local/NoWallets', function(event) {
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
self.hasProfile = true;
|
self.hasProfile = true;
|
||||||
self.noFocusedWallet = true;
|
self.noFocusedWallet = true;
|
||||||
self.isComplete = null;
|
self.isComplete = null;
|
||||||
self.walletName = null;
|
self.walletName = null;
|
||||||
go.path('import');
|
profileService.isDisclaimerAccepted(function(v) {
|
||||||
|
if (v) {
|
||||||
|
go.path('import');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue