Skip to content

Commit 6624fce

Browse files
committed
Update the warning message for localStorage securityError.
1 parent 1e01d1a commit 6624fce

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/theme-ui/src/color-modes.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ const storage = {
1111
try {
1212
return window.localStorage.getItem(STORAGE_KEY) || init
1313
} catch (e) {
14-
console.warn(e)
14+
console.warn(
15+
'localStorage is disabled',
16+
'and theming might not work as expected.',
17+
'Please check your Site Settings.'
18+
)
1519
}
1620
},
1721

1822
set: value => {
1923
try {
2024
window.localStorage.setItem(STORAGE_KEY, value)
2125
} catch (e) {
22-
console.warn(e)
26+
console.warn(
27+
'localStorage is disabled',
28+
'and theming might not work as expected.',
29+
'Please check your Site Settings.'
30+
)
2331
}
2432
},
2533
}

0 commit comments

Comments
 (0)