Fix unsupported pages if browser not support localStorage

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-20 18:48:17 -03:00
parent f1fe437f7b
commit 95bfd555f2
2 changed files with 6 additions and 5 deletions

View File

@ -79,6 +79,7 @@ module.exports = function(grunt) {
angular: {
src: [
'bower_components/fastclick/lib/fastclick.js',
'bower_components/modernizr/modernizr.js',
'bower_components/qrcode-generator/js/qrcode.js',
'bower_components/qrcode-decoder-js/lib/qrcode-decoder.js',
'bower_components/moment/min/moment-with-locales.js',

View File

@ -7,6 +7,11 @@ if (window && window.navigator) {
var isaosp = (rxaosp && rxaosp[1] < 537);
if (!window.cordova && isaosp)
unsupported = true;
if (!Modernizr.localstorage)
unsupported = true;
if (unsupported) {
window.location = '#/unsupported';
}
}
@ -463,11 +468,6 @@ angular
$rootScope.$emit('Animation/SwipeLeft');
}
if (unsupported) {
$state.transitionTo('unsupported');
event.preventDefault();
}
if (!profileService.profile && toState.needProfile) {
// Try to open local profile