2 parents 6f9ee92 + 1c75fec commit 8c9a35fCopy full SHA for 8c9a35f
1 file changed
public/theme-init.js
@@ -1,6 +1,11 @@
1
(() => {
2
- const storedTheme = localStorage.getItem('grades-theme');
3
- if (storedTheme === 'light') {
4
- document.documentElement.setAttribute('data-theme', 'light');
+ try {
+ const storedTheme = localStorage.getItem('grades-theme');
+ if (storedTheme === 'light') {
5
+ document.documentElement.setAttribute('data-theme', 'light');
6
+ }
7
+ } catch {
8
+ // Ignore storage access failures (privacy mode / blocked storage)
9
+ // and keep default theme.
10
}
11
})();
0 commit comments