mirror of https://github.com/BTCPrivate/copay.git
error handling
This commit is contained in:
parent
8217c7bfbd
commit
04e989ce44
|
@ -58,7 +58,7 @@
|
|||
</div>
|
||||
<div class="row" ng-show="!creatingProfile">
|
||||
<div class="start-button columns">
|
||||
<button ng-click="create()" class="button black expand round size-12 text-spacing" translate>
|
||||
<button ng-disabled="noProfile" ng-click="create()" class="button black expand round size-12 text-spacing" translate>
|
||||
GET STARTED
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -2,19 +2,11 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('disclaimerController',
|
||||
function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, applicationService, uxLanguage, go) {
|
||||
|
||||
self = this;
|
||||
$scope.noProfile = true;
|
||||
|
||||
$scope.create = function() {
|
||||
$scope.creatingProfile = true;
|
||||
if (isCordova) {
|
||||
window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true);
|
||||
}
|
||||
$scope.loading = true;
|
||||
storageService.setCopayDisclaimerFlag(function(err) {
|
||||
$scope.creatingProfile = false;
|
||||
if (isCordova) {
|
||||
window.plugins.spinnerDialog.hide();
|
||||
}
|
||||
applicationService.restart();
|
||||
});
|
||||
};
|
||||
|
@ -27,10 +19,17 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
|||
profileService.create({
|
||||
noWallet: noWallet
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
if (err && !'EEXIST') {
|
||||
$log.warn(err);
|
||||
$scope.error = err;
|
||||
$scope.$apply();
|
||||
$scope.noProfile = true;
|
||||
$timeout(function() {
|
||||
$scope.init();
|
||||
}, 3000);
|
||||
} else {
|
||||
$scope.error = "";
|
||||
$scope.noProfile = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue