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
|
||||
checkOK
|
||||
|
||||
cordova plugin add cordova.plugins.diagnostic
|
||||
checkOK
|
||||
|
||||
cordova plugin add cordova-plugin-splashscreen
|
||||
checkOK
|
||||
|
||||
|
@ -190,7 +193,7 @@ if [ $CURRENT_OS == "ANDROID" ]; then
|
|||
|
||||
# cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml
|
||||
# checkOK
|
||||
|
||||
|
||||
cp android/build-extras.gradle $PROJECT/platforms/android/build-extras.gradle
|
||||
checkOK
|
||||
|
||||
|
@ -243,5 +246,3 @@ if [ $CURRENT_OS == "WP8" ]; then
|
|||
checkOK
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<div translate>Use Unconfirmed Funds</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div ng-show="prefGlobal.usePushNotifications">
|
||||
<div ng-show="prefGlobal.usePushNotifications && PNEnabledByUser">
|
||||
<h4></h4>
|
||||
<ul class="no-bullet m0">
|
||||
<li>
|
||||
|
@ -78,7 +78,12 @@
|
|||
<div translate>About Copay</div>
|
||||
</li>
|
||||
</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>
|
||||
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue