From 1d1f8910514adadfbaf9f4e8f27a8aba1cd87a19 Mon Sep 17 00:00:00 2001 From: JSR Date: Thu, 19 Mar 2026 18:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DiOS=E7=AB=AF=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=B0=BA=E5=AF=B8=E8=A2=AB=E6=A1=8C=E9=9D=A2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=99=90=E5=88=B6=E5=AF=BC=E8=87=B4=E9=BB=91=E8=BE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 04df4f8..bc69f69 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -103,6 +103,35 @@ function MainContent(): React.JSX.Element { loadAuthAndSettings() }, []) + useEffect(() => { + const api = (window as any).api + if (!api || !isIosDevice) return + + const fitIosWindow = async () => { + try { + await api.windowSetResizable(false) + } catch { + void 0 + } + + try { + // 传入远大于设备尺寸的物理像素,交由系统裁剪为可用全屏区域 + await api.windowResize(10000, 10000) + } catch { + void 0 + } + } + + fitIosWindow().catch(() => void 0) + const timer = window.setTimeout(() => { + fitIosWindow().catch(() => void 0) + }, 300) + + return () => { + window.clearTimeout(timer) + } + }, [isIosDevice]) + const applySyncStrategy = async (strategy: "keep_local" | "keep_remote") => { const api = (window as any).api if (!api) return