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 = 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
angular
.module('copayApp')
@ -127,18 +141,17 @@ angular
}
$rootScope.$on('$routeChangeStart', function(event, next, current) {
if (!ls || ls.length < 1) {
if (unsupported) {
$location.path('unsupported');
} else {
if (!$rootScope.iden && next.logged) {
$idle.unwatch();
$location.path('/');
}
if ($rootScope.wallet && !$rootScope.wallet.isComplete()
&& next.walletShouldBeComplete) {
$location.path('/copayers');
}
return;
}
if (!$rootScope.iden && next.logged) {
$idle.unwatch();
$location.path('/');
}
if ($rootScope.wallet && !$rootScope.wallet.isComplete() && next.walletShouldBeComplete) {
$location.path('/copayers');
}
});
})

View File

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