Wallet/src/js/controllers/tab-settings.js

35 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-08-15 17:42:04 -03:00
'use strict';
2016-09-12 11:57:20 -03:00
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $rootScope, $log, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) {
2016-08-15 17:42:04 -03:00
2016-09-21 17:12:25 -03:00
var updateConfig = function() {
2016-08-15 17:42:04 -03:00
var config = configService.getSync();
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
var isIOS = platformInfo.isIOS;
2016-09-28 10:50:33 -03:00
$scope.usePushNotifications = isCordova && !isWP;
2016-09-05 14:59:11 -03:00
$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-15 17:42:04 -03:00
$scope.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) {
return w.id != self.walletId;
});
$scope.wallets = profileService.getWallets();
2016-08-15 17:42:04 -03:00
};
2016-09-23 12:42:33 -03:00
$scope.$on("$ionicView.enter", function(event, data) {
2016-09-21 17:12:25 -03:00
updateConfig();
});
2016-08-15 17:42:04 -03:00
});