Merge pull request #4035 from gabrielbazan7/fix/PNDisabled

If pn was not enabled by user, do not show pn switch in IOS
This commit is contained in:
Gustavo Maximiliano Cortez 2016-04-11 13:35:48 -03:00
commit 9357c9c1e3
3 changed files with 26 additions and 5 deletions

View file

@ -14,12 +14,27 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController',
this.feeOpts = feeService.feeOpts;
this.currentFeeLevel = feeService.getCurrentFeeLevel();
this.usePushNotifications = isCordova && !isMobile.Windows();
$scope.PNEnabledByUser = true;
$scope.isIOS = isMobile.iOS();
if (!typeof cordova.plugins.diagnostic != undefined && $scope.isIOS) {
cordova.plugins.diagnostic.isRemoteNotificationsEnabled(function(isEnabled) {
$scope.PNEnabledByUser = isEnabled;
});
}
$scope.spendUnconfirmed = config.wallet.spendUnconfirmed;
$scope.glideraEnabled = config.glidera.enabled;
$scope.glideraTestnet = config.glidera.testnet;
$scope.pushNotifications = config.pushNotifications.enabled;
};
this.openSettings = function() {
cordova.plugins.diagnostic.switchToSettings(function() {
$log.debug('switched to settings');
}, function(err) {
$log.debug(err);
});
}
var unwatchSpendUnconfirmed = $scope.$watch('spendUnconfirmed', function(newVal, oldVal) {
if (newVal == oldVal) return;
var opts = {