Skip to content

Commit e2464af

Browse files
vkarpov15Copilot
andauthored
Update docs/js/theme-toggle.js
Co-authored-by: Copilot <[email protected]>
1 parent 3398f0c commit e2464af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/js/theme-toggle.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
function applyTheme(theme, skipSetStorage) {
1919
document.documentElement.setAttribute('data-theme', theme);
2020
if (!skipSetStorage) {
21-
localStorage.setItem(STORAGE_KEY, theme);
21+
try {
22+
localStorage.setItem(STORAGE_KEY, theme);
23+
} catch (e) {
24+
// Silently fail - theme will still work for current session
25+
}
2226
}
2327
const isDark = theme === 'dark';
2428
document.documentElement.classList.toggle(CODE_THEME_CLASS, isDark);

0 commit comments

Comments
 (0)