Missing utils.

This commit is contained in:
Benjamin A. Shelton 2026-08-19 14:10:35 -06:00
commit 4e908fdafb
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

16
src/utils/utils.js Normal file
View file

@ -0,0 +1,16 @@
export const hasLocalStorage = () => {
try {
var ls = localStorage;
var key = "__test";
ls.setItem(key, key);
ls.removeItem(key);
return true;
} catch (e) {
return (
e instanceof DOMException &&
e.name === "QuotaExceededError" &&
localStorage &&
localStorage.length !== 0
);
}
}