mirror of
https://github.com/FranP-code/classify_saved_videos_yt.git
synced 2025-10-13 00:32:25 +00:00
Fix theme
This commit is contained in:
5665
web/pnpm-lock.yaml
generated
5665
web/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@ export function ThemeProvider({
|
||||
...props
|
||||
}: ThemeProviderProps) {
|
||||
const [theme, setTheme] = useState<Theme>(
|
||||
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
|
||||
() => (localStorage ? localStorage.getItem(storageKey) as Theme : undefined) || defaultTheme
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -51,7 +51,9 @@ export function ThemeProvider({
|
||||
const value = {
|
||||
theme,
|
||||
setTheme: (theme: Theme) => {
|
||||
localStorage.setItem(storageKey, theme)
|
||||
if (localStorage) {
|
||||
localStorage.setItem(storageKey, theme)
|
||||
}
|
||||
setTheme(theme)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ import { parseCSV } from '@/utils/csvParser';
|
||||
</head>
|
||||
|
||||
<body class="min-h-screen bg-background">
|
||||
<VideoClassifierApp client:load videos={videos} />
|
||||
<VideoClassifierApp client:only videos={videos} />
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user