Skip to content

Commit 942bdce

Browse files
fix(theme): Set theme defaults to system if no value is stored (#4760)
1 parent 60954ec commit 942bdce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/documentation-framework/hooks/useTheme.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class ThemeManager {
3939
if (!this.isBrowser) {
4040
return;
4141
}
42-
return localStorage.getItem(this.storageKey);
42+
const storedValue = localStorage.getItem(this.storageKey);
43+
return storedValue || this.defaultMode;
4344
}
4445

4546
setStoredValue(value) {

0 commit comments

Comments
 (0)