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
|
...props
|
||||||
}: ThemeProviderProps) {
|
}: ThemeProviderProps) {
|
||||||
const [theme, setTheme] = useState<Theme>(
|
const [theme, setTheme] = useState<Theme>(
|
||||||
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
|
() => (localStorage ? localStorage.getItem(storageKey) as Theme : undefined) || defaultTheme
|
||||||
)
|
)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -51,7 +51,9 @@ export function ThemeProvider({
|
|||||||
const value = {
|
const value = {
|
||||||
theme,
|
theme,
|
||||||
setTheme: (theme: Theme) => {
|
setTheme: (theme: Theme) => {
|
||||||
localStorage.setItem(storageKey, theme)
|
if (localStorage) {
|
||||||
|
localStorage.setItem(storageKey, theme)
|
||||||
|
}
|
||||||
setTheme(theme)
|
setTheme(theme)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ import { parseCSV } from '@/utils/csvParser';
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="min-h-screen bg-background">
|
<body class="min-h-screen bg-background">
|
||||||
<VideoClassifierApp client:load videos={videos} />
|
<VideoClassifierApp client:only videos={videos} />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user