We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6daad3f commit 89ee329Copy full SHA for 89ee329
src/defaults/asyncLocalStorage.js
@@ -9,9 +9,17 @@ const noStorage = process && process.env && process.env.NODE_ENV === 'production
9
}
10
11
function hasLocalStorage () {
12
+ let storageExists
13
try {
- return typeof window === 'object' && !!window.localStorage
14
+ storageExists = (typeof window === 'object' && !!window.localStorage)
15
+ if (storageExists) {
16
+ const testKey = 'redux-persist localStorage test'
17
+ window.localStorage.setItem(testKey, true)
18
+ window.localStorage.getItem(testKey)
19
+ window.localStorage.removeItem(testKey)
20
+ }
21
} catch (e) { return false }
22
+ return storageExists
23
24
25
function hasSessionStorage () {
0 commit comments