Wallet/src/js/controllers/preferencesCash.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-09-08 05:03:30 -03:00
'use strict';
angular.module('copayApp.controllers').controller('preferencesCashController', function($scope, $log, $timeout, appConfigService, lodash, configService, gettextCatalog, externalLinkService) {
2017-09-08 05:03:30 -03:00
var updateConfig = function() {
2017-09-08 05:03:30 -03:00
var config = configService.getSync();
$scope.appName = appConfigService.nameCase;
$scope.cashSupport = {
value: config.cashSupport
2017-09-08 05:03:30 -03:00
};
$timeout(function() {
$scope.$apply();
});
};
$scope.cashSupportChange = function() {
var opts = {
cashSupport: $scope.cashSupport.value
2017-09-08 05:03:30 -03:00
};
configService.set(opts, function(err) {
if (err) $log.debug(err);
});
};
$scope.openBitcoinCashWeb = function() {
var url = 'https://www.bitcoincash.org/';
var optIn = true;
var title = null;
var message = gettextCatalog.getString('Open bitcoincash.org?');
var okText = gettextCatalog.getString('Open');
var cancelText = gettextCatalog.getString('Go Back');
externalLinkService.open(url, optIn, title, message, okText, cancelText);
};
2017-09-08 05:03:30 -03:00
$scope.$on("$ionicView.enter", function(event, data) {
updateConfig();
});
});