mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-22 06:17:29 +08:00
fix: type error
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { Moon, Sun } from 'lucide-react';
|
import { Moon, Sun } from 'lucide-react';
|
||||||
@@ -19,12 +21,12 @@ export function ThemeToggle() {
|
|||||||
|
|
||||||
const toggleTheme = () => {
|
const toggleTheme = () => {
|
||||||
// 检查浏览器是否支持 View Transitions API
|
// 检查浏览器是否支持 View Transitions API
|
||||||
if (!document.startViewTransition) {
|
if (!(document as any).startViewTransition) {
|
||||||
setTheme(theme === 'dark' ? 'light' : 'dark');
|
setTheme(theme === 'dark' ? 'light' : 'dark');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.startViewTransition(() => {
|
(document as any).startViewTransition(() => {
|
||||||
setTheme(theme === 'dark' ? 'light' : 'dark');
|
setTheme(theme === 'dark' ? 'light' : 'dark');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user