2016-08-25 16:31:47 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
2017-11-13 16:49:59 +09:00
|
|
|
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, $ionicConfig, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope, firebaseEventsService) {
|
2016-10-11 22:46:07 -04:00
|
|
|
|
|
|
|
|
$scope.$on("$ionicView.afterEnter", function() {
|
|
|
|
|
startupService.ready();
|
|
|
|
|
});
|
2016-12-28 10:18:53 -03:00
|
|
|
|
|
|
|
|
$scope.$on("$ionicView.beforeEnter", function() {
|
2016-09-14 18:04:44 -03:00
|
|
|
$scope.lang = uxLanguage.currentLanguage;
|
2016-09-08 14:54:18 -03:00
|
|
|
$scope.terms = {};
|
2016-11-11 13:09:01 -05:00
|
|
|
$scope.accepted = {};
|
|
|
|
|
$scope.accepted.first = $scope.accepted.second = $scope.accepted.third = false;
|
2017-03-03 10:36:19 -03:00
|
|
|
$scope.backedUp = $stateParams.backedUp == 'false' ? false : true;
|
2017-02-23 14:26:05 -05:00
|
|
|
$scope.resume = $stateParams.resume || false;
|
2016-11-11 13:09:01 -05:00
|
|
|
$scope.shrinkView = false;
|
2016-12-28 10:18:53 -03:00
|
|
|
});
|
2016-08-25 16:31:47 -03:00
|
|
|
|
2017-03-03 10:36:19 -03:00
|
|
|
$scope.$on("$ionicView.enter", function() {
|
|
|
|
|
if ($scope.backedUp || $scope.resume) $ionicConfig.views.swipeBackEnabled(false);
|
|
|
|
|
});
|
|
|
|
|
|
2017-02-23 14:26:05 -05:00
|
|
|
$scope.$on("$ionicView.beforeLeave", function() {
|
|
|
|
|
$ionicConfig.views.swipeBackEnabled(true);
|
|
|
|
|
});
|
|
|
|
|
|
2016-08-25 16:31:47 -03:00
|
|
|
$scope.confirm = function() {
|
|
|
|
|
profileService.setDisclaimerAccepted(function(err) {
|
|
|
|
|
if (err) $log.error(err);
|
|
|
|
|
else {
|
2017-11-13 16:49:59 +09:00
|
|
|
firebaseEventsService.logEvent('completed_onboarding');
|
2016-09-19 12:06:46 -03:00
|
|
|
$state.go('tabs.home', {
|
|
|
|
|
fromOnboarding: true
|
|
|
|
|
});
|
2016-08-25 16:31:47 -03:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2016-09-14 18:04:44 -03:00
|
|
|
$scope.openExternalLink = function(url, target) {
|
|
|
|
|
externalLinkService.open(url, target);
|
|
|
|
|
};
|
|
|
|
|
|
2016-11-11 13:09:01 -05:00
|
|
|
$scope.openTerms = function() {
|
2016-11-21 10:39:38 -05:00
|
|
|
$scope.shrinkView = !$scope.shrinkView;
|
2016-11-11 13:09:01 -05:00
|
|
|
}
|
2016-09-29 14:50:33 -04:00
|
|
|
|
2016-10-11 12:23:21 -03:00
|
|
|
$scope.goBack = function() {
|
|
|
|
|
$state.go('onboarding.backupRequest', {
|
|
|
|
|
walletId: $stateParams.walletId
|
|
|
|
|
});
|
2016-09-29 14:50:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2016-08-25 16:31:47 -03:00
|
|
|
});
|