1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-28 11:52:16 -05:00

Hide wmail account creation in iOS app

This commit is contained in:
Tankred Hase 2015-04-27 11:28:38 +02:00
parent 4efab0daf0
commit 168eaf0086
2 changed files with 27 additions and 1 deletions

View File

@ -74,6 +74,32 @@ var AddAccountCtrl = function($scope, $location, $routeParams, $timeout, $q, mai
$location.path('/login-set-credentials'); $location.path('/login-set-credentials');
}); });
}; };
/**
* A helper function is detect if the app is running as an ios-cordova app
* @return {Boolean} if we are running on iOS
*/
$scope.checkIOS = function() {
if (!window.chrome || !chrome.runtime) {
$scope.isIOS = false;
return;
}
// check which runtime the app is running under
chrome.runtime.getPlatformInfo(function(platformInfo) {
$timeout(function() {
if (chrome.runtime.lastError || !platformInfo) {
$scope.isIOS = false; // assume not running of iOS if something goes wrong
return;
}
$scope.isIOS = platformInfo.os.indexOf('ios') !== -1;
});
});
};
// check platform on init
$scope.checkIOS();
}; };
module.exports = AddAccountCtrl; module.exports = AddAccountCtrl;

View File

@ -22,7 +22,7 @@
</div> </div>
</form> </form>
<p class="typo-paragraph"> <p class="typo-paragraph" ng-hide="isIOS">
Or sign up for an encrypted <a href="#create-account">Whiteout Mailbox</a>. Or sign up for an encrypted <a href="#create-account">Whiteout Mailbox</a>.
</p> </p>
</main> </main>