2016-08-15 17:42:04 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
2016-11-08 11:49:03 -03:00
|
|
|
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $window, $ionicModal, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService) {
|
2016-08-15 17:42:04 -03:00
|
|
|
|
2016-09-21 17:12:25 -03:00
|
|
|
var updateConfig = function() {
|
2016-09-05 14:59:11 -03:00
|
|
|
|
2016-10-28 10:13:40 -03:00
|
|
|
var config = configService.getSync();
|
2016-10-28 12:07:59 -04:00
|
|
|
var isCordova = platformInfo.isCordova;
|
|
|
|
|
var isWP = platformInfo.isWP;
|
|
|
|
|
|
|
|
|
|
$scope.usePushNotifications = isCordova && !isWP;
|
|
|
|
|
|
|
|
|
|
$scope.appName = $window.appConfig.nameCase;
|
|
|
|
|
|
2016-08-15 17:42:04 -03:00
|
|
|
$scope.unitName = config.wallet.settings.unitName;
|
|
|
|
|
$scope.currentLanguageName = uxLanguage.getCurrentLanguageName();
|
|
|
|
|
$scope.selectedAlternative = {
|
|
|
|
|
name: config.wallet.settings.alternativeName,
|
|
|
|
|
isoCode: config.wallet.settings.alternativeIsoCode
|
|
|
|
|
};
|
|
|
|
|
$scope.feeOpts = feeService.feeOpts;
|
|
|
|
|
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
|
2016-09-27 15:57:39 -03:00
|
|
|
|
2016-08-31 16:41:53 -03:00
|
|
|
$scope.wallets = profileService.getWallets();
|
2016-08-15 17:42:04 -03:00
|
|
|
};
|
|
|
|
|
|
2016-10-12 15:29:06 -04:00
|
|
|
$scope.openExternalLink = function(url, optIn, title, message, okText, cancelText) {
|
|
|
|
|
externalLinkService.open(url, optIn, title, message, okText, cancelText);
|
2016-10-07 11:35:43 -04:00
|
|
|
};
|
|
|
|
|
|
2016-09-30 13:19:29 -03:00
|
|
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
2016-09-21 17:12:25 -03:00
|
|
|
updateConfig();
|
|
|
|
|
});
|
|
|
|
|
|
2016-08-15 17:42:04 -03:00
|
|
|
});
|