mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add isStorageSupported()
This commit is contained in:
parent
80990bb7c4
commit
10fdfd2988
@ -315,6 +315,22 @@
|
|||||||
@endif
|
@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)
|
@if (!Auth::check() || !Auth::user()->registered)
|
||||||
validateSignUp();
|
validateSignUp();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user