Smooth start on mobile

This commit is contained in:
Gustavo Maximiliano Cortez 2015-08-19 11:16:55 -03:00
commit a13e12ff07
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 37 additions and 25 deletions

View file

@ -19,11 +19,13 @@
<div ng-show="!agreed">
<p translate>I affirm that I have read, understood, and agree with these terms.</p>
<button class="black round expand" ng-click="agree()">
<span translate> Agree </span>
<button class="black round expand" ng-click="agree()" ng-disabled="loading" translate>
Agree
</button>
</div>
<button ng-show="agreed && !index.hasProfile" class="round" ng-click="agree()" translate>Go back</button>
<button ng-show="agreed && !index.hasProfile" class="round" translate>
Go back
</button>
</div>
<div class="extra-margin-bottom"></div>
</div>

View file

@ -89,25 +89,27 @@ angular
$scope.create = function(noWallet) {
$scope.creatingProfile = true;
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);
}
});
$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);
};
}
}
}
});
$stateProvider
.state('translators', {
url: '/translators',
@ -125,7 +127,7 @@ angular
views: {
'main': {
templateUrl: 'views/disclaimer.html',
controller: function($scope, $timeout, storageService, applicationService, go) {
controller: function($scope, $timeout, storageService, applicationService, go, gettextCatalog, isCordova) {
storageService.getCopayDisclaimerFlag(function(err, val) {
$scope.agreed = val;
$timeout(function() {
@ -134,11 +136,20 @@ angular
});
$scope.agree = function() {
storageService.setCopayDisclaimerFlag(function(err) {
$timeout(function() {
applicationService.restart();
}, 1000);
});
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);
};
}
}
@ -531,7 +542,7 @@ angular
event.preventDefault();
}
/*
/*
* --------------------
*/
@ -630,7 +641,6 @@ angular
cachedBackPanel.getElementsByClassName('content')[0].scrollTop = sc;
cachedTransitionState = desiredTransitionState;
//console.log('CACHing animation', cachedTransitionState);
return false;
}
}