restrict aosp usage

This commit is contained in:
Matias Alejo Garcia 2014-12-16 13:04:39 -03:00
parent 130b3e9fc1
commit b93117defa
2 changed files with 28 additions and 19 deletions

View File

@ -3,6 +3,20 @@
var LS = require('../js/plugins/LocalStorage'); var LS = require('../js/plugins/LocalStorage');
var ls = new LS(); var ls = new LS();
var unsupported = false;
if (!ls || ls.length < 1)
unsupported = true;
if (window && window.navigator) {
var rxaosp = window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);
var isaosp = (rxaosp && rxaosp[1] < 537);
if (isaosp)
unsupported = true;
}
//Setting up route //Setting up route
angular angular
.module('copayApp') .module('copayApp')
@ -127,18 +141,17 @@ angular
} }
$rootScope.$on('$routeChangeStart', function(event, next, current) { $rootScope.$on('$routeChangeStart', function(event, next, current) {
if (unsupported) {
if (!ls || ls.length < 1) {
$location.path('unsupported'); $location.path('unsupported');
} else { return;
if (!$rootScope.iden && next.logged) { }
$idle.unwatch();
$location.path('/'); if (!$rootScope.iden && next.logged) {
} $idle.unwatch();
if ($rootScope.wallet && !$rootScope.wallet.isComplete() $location.path('/');
&& next.walletShouldBeComplete) { }
$location.path('/copayers'); if ($rootScope.wallet && !$rootScope.wallet.isComplete() && next.walletShouldBeComplete) {
} $location.path('/copayers');
} }
}); });
}) })

View File

@ -5,14 +5,10 @@
</div> </div>
<h1 translate class="text-center text-white">Browser unsupported</h1> <h1 translate class="text-center text-white">Browser unsupported</h1>
<h3 class="text-center text-white"> <h3 class="text-center text-white">
Copay uses WebStorage to save wallet data, Copay does not support your browser.
but your browser does not support it. Please use a current version of Google Chrome, Mozilla Firefox, Internet Explorer, Safari, or Opera.
Please use <br>
a current version of Internet Explorer, Safari, Google Chrome, Mozilla Firefox, or Opera. Note that localStorage should also be enabled (enabled by default in most cases).
<br><br>
Check if your browser support WebStorage <a
href="http://caniuse.com/#feat=namevalue-storage" target="_blank">here</a>
</h3> </h3>
</div> </div>