mirror of https://github.com/BTCPrivate/copay.git
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:
commit
9357c9c1e3
|
@ -97,6 +97,9 @@ if [ ! -d $PROJECT ]; then
|
||||||
cordova plugin add cordova-plugin-globalization
|
cordova plugin add cordova-plugin-globalization
|
||||||
checkOK
|
checkOK
|
||||||
|
|
||||||
|
cordova plugin add cordova.plugins.diagnostic
|
||||||
|
checkOK
|
||||||
|
|
||||||
cordova plugin add cordova-plugin-splashscreen
|
cordova plugin add cordova-plugin-splashscreen
|
||||||
checkOK
|
checkOK
|
||||||
|
|
||||||
|
@ -243,5 +246,3 @@ if [ $CURRENT_OS == "WP8" ]; then
|
||||||
checkOK
|
checkOK
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<div translate>Use Unconfirmed Funds</div>
|
<div translate>Use Unconfirmed Funds</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div ng-show="prefGlobal.usePushNotifications">
|
<div ng-show="prefGlobal.usePushNotifications && PNEnabledByUser">
|
||||||
<h4></h4>
|
<h4></h4>
|
||||||
<ul class="no-bullet m0">
|
<ul class="no-bullet m0">
|
||||||
<li>
|
<li>
|
||||||
|
@ -78,7 +78,12 @@
|
||||||
<div translate>About Copay</div>
|
<div translate>About Copay</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div ng-show="prefGlobal.usePushNotifications && !PNEnabledByUser && isIOS">
|
||||||
|
<div class="text-centered text-gray size-12 m10" translate>Push notifications for Copay are currently disabled. Enable them in the Settings app.</div>
|
||||||
|
<ul class="no-bullet m0" ng-click="prefGlobal.openSettings()">
|
||||||
|
<li ng-style="{'color':index.backgroundColor}" translate>Open Settings app</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<h4></h4>
|
<h4></h4>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
|
|
|
@ -14,12 +14,27 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController',
|
||||||
this.feeOpts = feeService.feeOpts;
|
this.feeOpts = feeService.feeOpts;
|
||||||
this.currentFeeLevel = feeService.getCurrentFeeLevel();
|
this.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||||
this.usePushNotifications = isCordova && !isMobile.Windows();
|
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.spendUnconfirmed = config.wallet.spendUnconfirmed;
|
||||||
$scope.glideraEnabled = config.glidera.enabled;
|
$scope.glideraEnabled = config.glidera.enabled;
|
||||||
$scope.glideraTestnet = config.glidera.testnet;
|
$scope.glideraTestnet = config.glidera.testnet;
|
||||||
$scope.pushNotifications = config.pushNotifications.enabled;
|
$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) {
|
var unwatchSpendUnconfirmed = $scope.$watch('spendUnconfirmed', function(newVal, oldVal) {
|
||||||
if (newVal == oldVal) return;
|
if (newVal == oldVal) return;
|
||||||
var opts = {
|
var opts = {
|
||||||
|
|
Loading…
Reference in New Issue