This commit is contained in:
Yidadaa 2023-04-21 01:18:49 +08:00
parent 693dcf12d6
commit 5185166e3b
2 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,6 @@ import {
HashRouter as Router,
Routes,
Route,
useNavigation,
useLocation,
} from "react-router-dom";
@ -131,7 +130,6 @@ function MobileScreen() {
export function Home() {
useSwitchTheme();
const isMobileScreen = useMobileScreen();
if (!useHasHydrated()) {

View File

@ -66,6 +66,9 @@ export function useMobileScreen() {
}
export function isMobileScreen() {
if (typeof window === "undefined") {
return false;
}
return window.innerWidth <= 600;
}