From 4e908fdafb0ed92164de235009331482be3dea42 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Wed, 19 Aug 2026 14:10:35 -0600 Subject: [PATCH] Missing utils. --- src/utils/utils.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/utils/utils.js diff --git a/src/utils/utils.js b/src/utils/utils.js new file mode 100644 index 0000000..b899baa --- /dev/null +++ b/src/utils/utils.js @@ -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 + ); + } +} \ No newline at end of file