add coin to preferences/info
+ refactor duplicate
This commit is contained in:
parent
fbda525e6d
commit
acc1549633
13 changed files with 212 additions and 146 deletions
|
|
@ -1,12 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesCashController', function($scope, $log, $timeout, appConfigService, lodash, configService, platformInfo, pushNotificationsService, emailService) {
|
||||
angular.module('copayApp.controllers').controller('preferencesCashController', function($scope, $log, $timeout, appConfigService, lodash, configService, gettextCatalog, externalLinkService) {
|
||||
var updateConfig = function() {
|
||||
|
||||
var config = configService.getSync();
|
||||
$scope.appName = appConfigService.nameCase;
|
||||
|
||||
$scope.cashSupport = {
|
||||
value: config.wallet.cashSupport.enabled
|
||||
value: config.cashSupport
|
||||
};
|
||||
|
||||
$timeout(function() {
|
||||
|
|
@ -16,15 +17,25 @@ angular.module('copayApp.controllers').controller('preferencesCashController', f
|
|||
|
||||
$scope.cashSupportChange = function() {
|
||||
var opts = {
|
||||
wallet: {
|
||||
cashSupport: $scope.cashSupport.value
|
||||
}
|
||||
cashSupport: $scope.cashSupport.value
|
||||
};
|
||||
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);
|
||||
};
|
||||
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
updateConfig();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue