2016-08-25 16:31:47 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
2016-12-27 15:19:53 -03:00
|
|
|
angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, appConfigService, uxLanguage, profileService, externalLinkService, gettextCatalog) {
|
2016-08-25 16:31:47 -03:00
|
|
|
$scope.lang = uxLanguage.currentLanguage;
|
|
|
|
|
|
|
|
|
|
$scope.confirm = function() {
|
|
|
|
|
profileService.setDisclaimerAccepted(function(err) {
|
|
|
|
|
if (err) $log.error(err);
|
|
|
|
|
else {
|
2016-09-19 12:06:46 -03:00
|
|
|
$state.go('tabs.home', {
|
|
|
|
|
fromOnboarding: true
|
|
|
|
|
});
|
2016-08-25 16:31:47 -03:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2016-12-12 17:29:11 -03:00
|
|
|
$scope.openExternalLink = function() {
|
2016-12-27 15:19:53 -03:00
|
|
|
var url = appConfigService.disclaimerUrl;
|
2016-12-12 17:29:11 -03:00
|
|
|
var optIn = true;
|
|
|
|
|
var title = gettextCatalog.getString('View Terms of Service');
|
2016-12-28 16:29:45 -03:00
|
|
|
var message = gettextCatalog.getString('The official English Terms of Service are available on the BitPay website.');
|
2016-12-12 17:29:11 -03:00
|
|
|
var okText = gettextCatalog.getString('Open Website');
|
|
|
|
|
var cancelText = gettextCatalog.getString('Go Back');
|
2016-10-12 15:29:06 -04:00
|
|
|
externalLinkService.open(url, optIn, title, message, okText, cancelText);
|
2016-09-05 14:59:11 -03:00
|
|
|
};
|
|
|
|
|
|
2016-08-25 16:31:47 -03:00
|
|
|
});
|