From eef0134ddca37a700a714bed7d96ca726ea3a1b1 Mon Sep 17 00:00:00 2001 From: richarjiang Date: Sat, 6 Dec 2025 10:05:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E4=BC=98=E5=8C=96Expo=20Updates?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A3=80=E6=9F=A5=E6=9C=BA=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/_layout.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/_layout.tsx b/app/_layout.tsx index d9006f0..04c1ff2 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -485,7 +485,17 @@ function Bootstrapper({ children }: { children: React.ReactNode }) { getPrivacyAgreed(); }, []); + // 使用 ref 确保更新检查只执行一次 + const updateCheckRequestedRef = React.useRef(false); + useEffect(() => { + // 如果已经执行过更新检查,直接返回 + if (updateCheckRequestedRef.current) { + return; + } + + updateCheckRequestedRef.current = true; + async function checkUpdate() { try { logger.info(`Checking for updates..., env: ${__DEV__}, Updates.isEnabled: ${Updates.isEnabled}`);