delete unused disclaimer.js
This commit is contained in:
parent
74e6897d66
commit
8391aeeb55
1 changed files with 0 additions and 69 deletions
|
|
@ -1,69 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('disclaimerController',
|
||||
function($scope, $rootScope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, $state, storageService, gettext, platformInfo, ongoingProcess) {
|
||||
var tries = 0;
|
||||
var isCordova = platformInfo.isCordova;
|
||||
|
||||
ongoingProcess.set('creatingWallet', true);
|
||||
|
||||
var create = function(opts) {
|
||||
opts = opts || {};
|
||||
$log.debug('Creating profile');
|
||||
|
||||
profileService.create(opts, function(err) {
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
$scope.error = err;
|
||||
$scope.$apply();
|
||||
|
||||
return $timeout(function() {
|
||||
$log.warn('Retrying to create profile......');
|
||||
if (tries == 3) {
|
||||
tries == 0;
|
||||
return create({
|
||||
noWallet: true
|
||||
});
|
||||
} else {
|
||||
tries += 1;
|
||||
return create();
|
||||
}
|
||||
}, 3000);
|
||||
};
|
||||
$scope.error = "";
|
||||
ongoingProcess.set('creatingWallet', false);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.init = function(opts) {
|
||||
$ionicSideMenuDelegate.canDragContent(false);
|
||||
$scope.lang = uxLanguage.currentLanguage;
|
||||
|
||||
storageService.getProfile(function(err, profile) {
|
||||
if (!profile) {
|
||||
create(opts);
|
||||
} else {
|
||||
$log.info('There is already a profile');
|
||||
ongoingProcess.set('creatingWallet', false);
|
||||
profileService.bindProfile(profile, function(err) {
|
||||
if (!err || !err.message || !err.message.match('NONAGREEDDISCLAIMER')) {
|
||||
$log.debug('Disclaimer already accepted at #disclaimer. Redirect to Wallet Home.');
|
||||
$ionicSideMenuDelegate.canDragContent(true);
|
||||
$state.go('tabs.home');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.accept = function() {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
else {
|
||||
$ionicSideMenuDelegate.canDragContent(true);
|
||||
$rootScope.$emit('disclaimerAccepted');
|
||||
$state.go('tabs.home');
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue