Add isStorageSupported()

This commit is contained in:
Hillel Coren 2016-07-20 20:01:25 +03:00
parent 80990bb7c4
commit 10fdfd2988

View File

@ -315,6 +315,22 @@
@endif
}
function isStorageSupported() {
if ('localStorage' in window && window['localStorage'] !== null) {
var storage = window.localStorage;
} else {
return false;
}
var testKey = 'test';
try {
storage.setItem(testKey, '1');
storage.removeItem(testKey);
return true;
} catch (error) {
return false;
}
}
@if (!Auth::check() || !Auth::user()->registered)
validateSignUp();