修复部分浏览器判定为app的bug

This commit is contained in:
qaq
2025-08-21 21:52:04 +08:00
parent 07a0b9e3fa
commit 365387576f
13 changed files with 183 additions and 168 deletions
+2 -7
View File
@@ -5,6 +5,7 @@ import {
NavbarBrand,
NavbarContent,
} from "@heroui/navbar";
import { isWebViewFunc } from '@/utils/panel';
import { useNavigate } from "react-router-dom";
import { Logo } from "@/components/icons";
@@ -18,13 +19,7 @@ export const Navbar = () => {
// 检测是否在WebView中运行
useEffect(() => {
if((window as any).JsInterface !== undefined) {
setIsWebView(true);
}else if((window as any).webkit && (window as any).webkit.messageHandlers) {
setIsWebView(true);
}else {
setIsWebView(false);
}
setIsWebView(isWebViewFunc());
}, []);